We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi - just upgraded a MODx site to 2.6.5 and was updating the EXTRAs - notably formit from 3.0.2 to 4.1.0 and the installation of this new version would not work - I then out of curiosity went to view the page where the formit form was on and got a 500 error... then went back to the manager and now I get 500 errors and cant see the manager????

    Any ideas what is going on and how to fix???

    Looks like same issues here > https://github.com/Sterc/FormIt/issues/183

    This question has been answered by dubbs. See the first response.

    [ed. note: dubbs last edited this post 5 years, 8 months ago.]
      • 8168
      • 1,118 Posts
      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...????
        • 8168
        • 1,118 Posts
        Is there a way to debug what the error is???

        Looking in server log - I see the same issue reported here > https://forums.modx.com/thread/103766/formit-4-0-update-broke-manager-login [ed. note: dubbs last edited this post 5 years, 8 months ago.]
          • 8168
          • 1,118 Posts
          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
            • 8168
            • 1,118 Posts
            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 5 years, 8 months ago.]
              • 3749
              • 24,544 Posts
              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.

                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 8168
                • 1,118 Posts
                Quote from: BobRay at Aug 16, 2018, 07:59 PM
                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 for the reply Bob - if its not deprecated - then yeh, I tend to agree - it's not a worthy change... breaking the manager with no clue as to why is a real pain to debug!
                  • 22840
                  • 1,572 Posts
                  Quote from: dubbs at Aug 16, 2018, 08:33 PM
                  Quote from: BobRay at Aug 16, 2018, 07:59 PM
                  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 for the reply Bob - if its not deprecated - then yeh, I tend to agree - it's not a worthy change... breaking the manager with no clue as to why is a real pain to debug!

                  Just had the same issue dubbs, thanks for the fix, I was able to increase the php version to 7.0.31 [ed. note: paulp last edited this post 5 years, 7 months ago.]
                    • 9439
                    • 90 Posts
                    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