New Community Forums are coming. Watch this space for news.
Subscribe: RSS
  • 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 7 months ago.]
    • 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...????
      • 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 7 months ago.]
        • 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 7 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.

                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
              • 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!
                • 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 6 months, 1 week ago.]
                  • 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