We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38142
    • 91 Posts
    Upgrading from 2.6.5 to 2.7, and failing when setup returns an error message saying there is a missing bracket on a certain line in the core/model/modx/modx.class.php file. So I download the file, and don't see a missing bracket.

    So try again running set up. click to install and get a white screen.

    Try uploading 2.6.5 again and running that setup. Same white screen.

    Now have to restore the backup.

    Tried the same on a second site and succeeded with no error message. Then tried on a third site, and have the same problem as the first.

    Any advice on how to consistently upgrade to 2.7 from 2.6.5 without getting error messages about apparently missing brackets?

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

      • 3749
      • 24,544 Posts
      It could be something in the site cache or a plugin that's being triggered by setup.

      Try manually deleting all files in the core/cache directory. If that doesn't work, try disabling all plugins by right-clicking on them in the Elements tree and then clear the cache files again before running setup.
        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
        • 38142
        • 91 Posts
        Quote from: BobRay at Jan 30, 2019, 08:17 PM
        It could be something in the site cache or a plugin that's being triggered by setup.

        Try manually deleting all files in the core/cache directory. If that doesn't work, try disabling all plugins by right-clicking on them in the Elements tree and then clear the cache files again before running setup.

        Thank you for the reply, Bob. Did what you suggest, including deleting the core/cache, and got past the missing bracket error, but then hit another wall: On the list of pre-installation tests it says: "Database connection failed!" But when I check the core/config/config.inc.php file, the database details are correct. I assume clicking the option to "Create the database" would be fatal, so I will go back and restore 2.6.5 again and postpone the update to 2.7.

          • 38142
          • 91 Posts
          Just for the record: When I clear the cache (and with the only plugin - TinyMCE - deactivated) again after seeing the database connection error message, and go back to retry the setup, I immediately see the bracket error message again:

          "Parse error: syntax error, unexpected '[' in /home/hdixon/core/model/modx/modx.class.php on line 283"

          I download the said file and see on line 283:

          private $loggedDeprecatedFunctions = [];

          What is unexpected there?
            • 3749
            • 24,544 Posts
            Yes, creating the DB would be fatal. The DB credentials are in two places in that config file, but assuming that they're correct, maybe your host's DB server is overloaded and sometimes refusing requests? Thousands of people have upgraded from 2.6.5 to 2.7.0 with no issues (I've actually done it dozens of times while testing UpgradeMODX) so that's a very weird error.
              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
              • 38142
              • 91 Posts
              Thank you again, Bob. Had another go. Took the site back to the way it was before uploading 2.7.zip. Uploaded again. Moved folders/files. Ran Setup, got to the screen where you choose upgrade rather than new install, then clicked to upgrade, and am shown this again:

              Parse error: syntax error, unexpected '[' in /home/hdixon/core/model/modx/modx.class.php on line 283

              Just out of curiosity, take the site back again, upload the setup folder for 2.6.5. Run Setup for 2.6.5, and it works first time.

              But can't for the life of me run setup for 2.7.

              Am just gonna wait for 2.7.1 and keep my fingers crossed that I can get that to work.

                • 3749
                • 24,544 Posts
                That error could be caused by JavaScript code that has something like '[[[' in it and isn't inside cData tags, though why that would affect 2.7 and not 2.6.5 is a mystery.

                You might watch the Network tab in Chrome Dev. Tools to see if you can catch a connector returning something from a processor that MODX can't parse.
                  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
                  • 38142
                  • 91 Posts
                  Quote from: BobRay at Feb 01, 2019, 11:44 PM
                  That error could be caused by JavaScript code that has something like '[[[' in it and isn't inside cData tags, though why that would affect 2.7 and not 2.6.5 is a mystery.

                  You might watch the Network tab in Chrome Dev. Tools to see if you can catch a connector returning something from a processor that MODX can't parse.

                  Sorry for the delay in getting back to this - had to leave it for a while as it was just too depressing. Anyway, back now with another site I have to upgrade. Same problem. Both for 2.7.0 and 2.7.1. I get to the options page in Setup where you have to select Upgrade Existing Install, then when I click to install I get the error message again:

                  Parse error: syntax error, unexpected '[' in /home/finca/core/model/modx/modx.class.php on line 283

                  Checked the activity in Chrome Dev Tools and don't see anything there. No Javascript running, anyway, just the index.php?action=summary and a 404 for the missing favicon.ico.

                  Tried the Advaced Upgrade option on the page where you have to specify whether this is a new install or not, but after I enter the DBase details the link to test the collation does not work in my browsers and so cannot attempt the upgrade that way either.

                  Completely stuck on how to get past the parse error and upgrade to 2.7.0 (now 2.7.1).
                    • 38142
                    • 91 Posts
                    Bob, I noticed you said something about plugins possibly messing up the upgrade process in another thread, so tried removing the two plugins on this site (getResources and TinyMCE). Ran setup again for 2.7.0, but got the same error again.

                    When I run 2.6.5 setup with the 2.6.5 folders (as I have to do each time I fail with 2.7.0) it works fine and we go back to the lovely way things were in carefree 2018.

                      • 38142
                      • 91 Posts
                      Latest sad update:

                      Tried a fresh install of 2.7.1 in a subfolder of the site in question (where 2.6.5 is running perfectly happily) using a new MySQL database and keeping the core for 2.7.1 separate from the one for 2.6.5.

                      Got to the page where you enter the dbase details. Entered them and clicked to install. Got the next page that says: "Core installation was successful. Click Next to complete the installation," and - BAM! - same damned error message:

                      Parse error: syntax error, unexpected '[' in /home/finca/public_html/test/core/model/modx/modx.class.php on line 283


                      I see the modx table looking nice in PHPmyadmin, and the config.inc.php file in core/config looks correct.

                      This is shared hosting on Linux, running PHP 5.3.29 and dbase: 10.1.37-MariaDB-cll-lve. The server software is Litespeed, not Apache. Could that be the cause of all the woes?



                      [ed. note: cottagestuff last edited this post 5 years, 2 months ago.]