Adding the new While action shouldn’t affect existing server action files
…YOUR TEXT HERE …
Actual behavior
Some exising action files no longer work correctly
…YOUR TEXT HERE …
How to reproduce
I’m not sure exactly what triggers this, but if you try running a number of your existing action files which include conditions, you will probably find this error: **Parse error** : syntax error, unexpected 'while' (T_WHILE), expecting identifier (T_STRING) in ...
Eg, this action file toggles the status of a record. I probably use it for most tables in a CRUD system. It no longer works - failing with the error above.
If I comment out this section of \dmxConnectLib\modules\core.php:
all is well again.
(I couldn’t get the new while loop to work, but that’s not such a problem at the moment)
In case it helps, if I run core.php directly in the browser, I get:
**Fatal error** : Class 'lib\core\Module' not found in **/home/..mypath../dmxConnectLib/modules/core.php** on line **9**
This issue causes problems generally on the site I’m working on - not just with a few server actions. It’s not a problem as long as the problem code is commented out. I’m not sure of the circumstances when these files are automatically updated/replace. That could be problematic.
Can you try removing the dmxConnectLib folder locally, then save your server action and then uploading manually the newly created dmxConnectLib folder to the server?
Thanks Teodor, but unfortunately that didn’t work.
I closed Wappler - using the Windows tray quit option - and deleted the folder dmxConnectLib. After saving one of the server action file affected, the folder was recreated, but the problem is the same.
What is the PHP version on your server where you get the error? We should probably rename the action method to something else when some PHP versions don’t like while as method name.
I had forgotten I had set WAMP to use PHP 5.6 when working on old site. I changed it to 7.2 and the problem is fixed. On the server I had created a subdomain for temporary use and it was using the default PHP 5.6 too. I’ve changed it to 7.2 and it’s all working fine now.