re-run setup a number of times which goes ok - but still no manager or page in site that has the formit form on it...
removed formit from the core>packages directory... still no joy...????
The error is:
mod_fcgid: stderr: PHP Parse error: syntax error, unexpected '[' in /core/components/formit/src/FormIt.php on line 24
Line 24 is:
public $config = [];
How can i edit this to make it PHP 5.3.3 compliant?
discuss.answer
OK.. so to fix.. as I am running PHP 5.3.3 on this server and Formit 4.1.0 is made for PHP versions higher than that - I had to look in server error logs and find all errors where an array was declared as [] and replaced it with array() -
Quite a few files to update.. but seems to be working now...
I had to amend code in these locations:
core/components/formit/controllers/home.class.php
core/components/formit/model/formit/formitform.class.php
core/components/formit/src/Formit.php
core/components/formit/src/Formit/Dictionary.php
core/components/formit/src/Formit/Hook.php
core/components/formit/src/Formit/Request.php
core/components/formit/src/Formit/Hook/Email.php
core/components/formit/src/Formit/Hook/Redirect.php
core/components/formit/src/Formit/Hook/Saveform.php
[ed. note: dubbs last edited this post 6 years, 5 months ago.]
Either the FormIt code, or the
server requirements here should be changed, imo.
I would vote for the former. There's no reason to use the new-style array syntax in MODX. The old-style syntax is not going away and, as we've seen, using the new style will actually crash some MODX user's sites. AFAIK, the new style is strictly cosmetic and the old style is not deprecated.
Thanks dubbs. Same issue.
For anyone else landing here, be careful what brackets you change. For me, I changed everything in dubbs' list and it didn't work. I had to then plough through the error log changing one line at at time. (I guess if, unlike me, you know your square brackets from your round you can scoot through the list).
Anyway, upshot is that my site's back to normal, with formit 3 back installed. Scary though - I've never had a problem updating Modx Extras, ever. I'll be a little more cautious from now on.
David Heriot
pfsmedia