Multi page form not working on PHP 7

Parcs

New Member
Hi, I have a multi page form which have always worked under php 5.6, and it's still working fine. Newest versions of Joomla suggested to switch on PHP 7, and when I tried on my server my multi page form stopped working: when I press 'next' button, it hangs on 'validating' and never goes to next page.
If I roll back to php 5.6, it works again.

I have 'is not empty' and 'is greater or less' validation rules, and some conditional fields, but I think that's not the problem: if I turn off multi page form and use a single form, validation is working and data are correctly submitted even with PHP 7.

Any ideas?
Thank you.
 
I can't replicate that here.

Try setting your J! error logging to max, then in Chrome, open Dev Tools (ctrl-shift-i), and look in the Network tab. WHen you hit the Next page button, you'll see an AJAX call fire off in the Network tab. Look at the Response section for that call, and see if there's an error message embedded in the response.

-- hugh
 
Hi cheesegrits, thank you for your response.
I did as you told, and this is what I see on Network tab when I click Next button:

Name: index.php?option=com_fabrik&format=raw&task=form.ajax_validate&form_id=12
Status: 500
Type: xhr
Initiator: jquery.js?11b9e5d293a8603524d51d57f9bcddab:10254
Size: 4.5 KB
Time: 439 ms​

If I click on the url marked red (index.php?option=com_fabrik&format=raw&task=form.ajax_validate&form_id=12), I can see the Preview and Response tab, and this is the error reported:

syntax error, unexpected '==' (T_IS_EQUAL), expecting ';'
.../components/com_fabrik/models/validation_rule.php(144) : eval()'d code:1

Call stack
# Function Location
1 () JROOT/components/com_fabrik/models/validation_rule.php(144) : eval()'d code:1
2 PlgFabrik_Validationrule->shouldValidate() JROOT/components/com_fabrik/models/form.php:2361
3 FabrikFEModelForm->validate() JROOT/components/com_fabrik/controllers/form.php:572
4 FabrikControllerForm->ajax_validate() JROOT/libraries/src/MVC/Controller/BaseController.php:710
5 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/components/com_fabrik/fabrik.php:181
6 require_once() JROOT/libraries/src/Component/ComponentHelper.php:381
7 Joomla\CMS\Component\ComponentHelper::executeComponent() JROOT/libraries/src/Component/ComponentHelper.php:356
8 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/SiteApplication.php:194
9 Joomla\CMS\Application\SiteApplication->dispatch() JROOT/libraries/src/Application/SiteApplication.php:233
10 Joomla\CMS\Application\SiteApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:267
11 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49
If I click on the Initator marked red (jquery.js?11b9e5d293a8603524d51d57f9bcddab:10254), I can see the following line (line 10254 of ../media/jui/js/jquery.js) marked as error in Sources tab:

xhr.send( ( options.hasContent && options.data ) || null );​

The error reported is "Failed to load resource: the server responded with a status of 500 (Internal Server Error)"

I'm using Joomla 3.8.3 and Fabrik 3.8 with T3 blank template. If I switch to protostar, the issue is not solved.
Only rolling back from php 7.0 to php 5.6 solves the problem.

I hope you can help me figure it out.
Thanks a lot.
 
syntax error, unexpected '==' (T_IS_EQUAL), expecting ';'
.../components/com_fabrik/models/validation_rule.php(144) : eval()'d code:1
[/QUOTE]

seems you have custom code (php validation? condition? ) which is not php7 compatible

Gesendet mit Tapatalk
 
Yup, line 144 is in shouldValidate(), where it runs the custom validation condition code.

Well, actually that should be line 149, so the Fabrik install probably isn't 3.8.

But anyway. The error is in your validation condition code.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top