We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26503
    • 620 Posts
    I'm having an issue upgrading to modx 2.6.5 on a Centos7 Apache/PHP7.1 server and need HELP!!

    I originally got stuck trying to migrate a 2.1.11 modx site from an old server to this new one - I actually had to downgrade PHP to 2.6 on the new server, migrate modx and them upgrade through various versions (2.2.15, 2.3, 2.4 etc)to get the modx site to v2.6.5 everything was working just fine, no console errors, no modx log errors, no webserver errors. so I upgraded the server to PHP7.1 - now the manager for 2.6.5 is blank except for the top nav bar (which actually still navigates) and I am stumped as I have migrated probably 80 sites to PHP7.1 without any issues at all.

    After upgrading to PHP7.1:
    - no errors in the modx log
    - no errors in the apache logs
    - no php errors output
    - you can log into the manager & see the top nav bar, but the rest of the page is blank.
    - the console is full of JS errors:
    - all other sites on the server run just fine

    Uncaught SyntaxError: Unexpected token ; >>> modx.config.js.php?action=security/profile&wctx=mgr:1
    Uncaught TypeError: Cannot read property 'toLowerCase' of undefined >>> multiuploaddialog.js:3
    Uncaught TypeError: Cannot set property 'change_password' of undefined >>> ?a=security/profile:69
    Uncaught TypeError: Cannot read property 'id' of undefined >>> modx.js?v=f84b0b45:938
    Uncaught TypeError: Cannot read property 'change_password' of undefined >>> update.js:50
    etc...

    - the network tab on the inspector is showing no errors in retrieving the scripts or mime types or anything.

    So pretty much no help for the system logs... I did all the common checking as well:
    - checked for the old css/js compression thing (which I think is no longer an issue)
    - checked all 3 config.core.php files
    - checked everything (3x) in config/config.inc.php
    - checked every setting in the modx_system_settings table.
    - checked (double and triple) file/directory permissions AND ownerships.
    - reinstalled 2.6.5 ..... twice.

    Everything checked out, like I mentioned - no errors other than the javascript errors.


    So, everything on the new server is to be running under PHP7.1 - so installing/configuring a 5.6 just for this site is not in the cards. nor is downgrading to 5.6, as I'll just have to upgrade again.

    So... does anyone have a similar situation, seen the JS errors/have a solution?

    -thanks.


    update

    If I do a fresh modx install in another container and just point the broken manager at it (database), the manager will work perfectly, then when I point it back to the old database, it still works perfect until the cache gets cleared. then it breaks again.


    [ed. note: sean69 last edited this post 8 years, 3 months ago.]
      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

      Sean Kimball CLP, CLS.
      Technical Director / Sr. Developer | BigBlock Studios
      ._______________________________________________.
      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
      phone/fax: 905-426-5525
      • 20413
      • 2,877 Posts
      I would test install MODX from scratch in a subfolder! Does your
      php info looks ok?

      I see your update now!

      Try rename core/cache to core/cache-old
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 38783
        • 571 Posts
          If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

          email: [email protected] | website: https://andytough.com
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          I don't think this is related to PHP, as you're getting a SyntaxError in the javascript:

          Uncaught SyntaxError: Unexpected token ; >>> modx.config.js.php?action=security/profile&wctx=mgr:1

          I'd be interested in seeing the output of that file being mentioned, however you should probably not post that publicly if it contains anything. "unexpected token ;" sounds like it may be unable of loading the system settings. Could be an issue getting to the database; what you mention about it working with the other installation until you switch over the config and clear the cache would support that theory.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 26503
            • 620 Posts
            Quote from: markh at Jul 18, 2018, 06:57 AM
            I don't think this is related to PHP, as you're getting a SyntaxError in the javascript:

            Uncaught SyntaxError: Unexpected token ; >>> modx.config.js.php?action=security/profile&wctx=mgr:1

            I'd be interested in seeing the output of that file being mentioned, however you should probably not post that publicly if it contains anything. "unexpected token ;" sounds like it may be unable of loading the system settings. Could be an issue getting to the database; what you mention about it working with the other installation until you switch over the config and clear the cache would support that theory.

            That's what I thought, JS errors, not server/php errors, but they only manifested themselves after the update to PHP7.1 ....

            I did get it working though, while I had it working from the cache created by pointing it to the new database I removed all the extras in an effort to reduce the number of things that could be going on.... cleared cache and it worked. Reinstalled all the extras and it continued to work. Soooo hard to say, I think it was probably a broken plugin/out of date plugin? Do not know.

            But out of interest here are the plugins that were installed:

            modActiveDirectory, CKEditor, CMPGenerator, CodeMirrow, Formit, FormitBuilder, getPage, getResources, Login, modDevTools, Peoples, WayFinder

            After uninstalling everything and leaving out anything that was not used, the extras I have on a working installation are:

            modActiveDirectory, CKEditor, CodeMirrow, Formit, getPage, getResources, Login, Peoples, WayFinder

            Still no idea what had happened. (and unwilling to try to replicate as it took 12 hours to get it working!!)

            -thanks
            -sean
              *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

              Sean Kimball CLP, CLS.
              Technical Director / Sr. Developer | BigBlock Studios
              ._______________________________________________.
              Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
              27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
              phone/fax: 905-426-5525
              • 3749
              • 24,544 Posts
              The 'Unexpected token ; >>> ' error is usually caused by a PHP error or E_NOTICE error thrown in a processor (often by a CMP). The error message gets returned as part of the return value and is invalid JSON -- hence the crash.

              There's method here for finding the culprit: https://bobsguides.com/blog.html/2013/05/22/debugging-cmps-a-horror-story/.

              A call to a deprecated function or a function that was removed in PHP 7 is the usual cause. Most of the time, it's an easy fix *if* you can find it.

                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
                • 18373 ☆ A M B ☆
                • 3,141 Posts
                Uncaught SyntaxError: Unexpected token <
                indeed means there's HTML where it is not expected, often a PHP notice/error, but
                Uncaught SyntaxError: Unexpected token ;
                suggests the ";" character is not where it should be. As the modx.config.js.php file takes the format of a JSON object like:
                MODx.config = {"foo":"bar"};
                in normal circumstances, that implies the
                {"foo":"bar"}
                part is missing and it just has the
                ;
                .

                That article is a great resource for when people have the < unexpected token, but not the same problem as this one, I think.

                I'm still curious why this was happening, a plugin from that list seems unlikely to me to have an effect on the config being loaded or not... maybe one of those extras had invalid characters in one of its setting that could not be encoded to JSON? Shame we wont find out now that it's fixed :p
                  Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

                  Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
                  • 26503
                  • 620 Posts
                  Well, since yourself & Bob are that curious:

                  The app has always had a clone for development & testing, so I migrated the site to where the dev site will be, went through the upgrade process and have it just as broken as the original was smiley weird how that is a success eh?

                  So it is upgraded to modx 2.6.5, only the menubar appears in the manager, the frontend functions & I get the same javascript console errors.

                  SO - I really don't have a ton of time to monkey around with it, but if you guys have some specific test cases to run against it let me know (explicitly) & I will try to keep up. Unfortunately it is behind a VPN and deals with financial data, privacy act applies - so I can't turn you loose on it sad


                  BUT:
                  To start, here is the complete log from the console from the manager dashboard page [attached]
                    *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                    Sean Kimball CLP, CLS.
                    Technical Director / Sr. Developer | BigBlock Studios
                    ._______________________________________________.
                    Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                    27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                    phone/fax: 905-426-5525
                    • 26503
                    • 620 Posts
                    forum is acting really weird - keeps replacing my post with the OP! huh
                    Trying to attach file again. didn't work, log is inline:


                    modx.config.js.php?action=&wctx=mgr:1 Uncaught SyntaxError: Unexpected token ;
                    multiuploaddialog.js:3 Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
                        at multiuploaddialog.js:3
                        at multiuploaddialog.js:563
                    (anonymous) @ multiuploaddialog.js:3
                    (anonymous) @ multiuploaddialog.js:563
                    modx.htmleditor.js:104 Uncaught TypeError: Cannot read property 'browser' of undefined
                        at modx.htmleditor.js:104
                    (anonymous) @ modx.htmleditor.js:104
                    modx.js?v=07eb0c0a:938 Uncaught TypeError: Cannot read property 'id' of undefined
                        at MODx.HttpProvider.readState (modx.js?v=07eb0c0a:938)
                        at new MODx.HttpProvider (modx.js?v=07eb0c0a:793)
                        at MODx.Layout.Default.MODx.Layout [as constructor] (modx.layout.js:25)
                        at new MODx.Layout.Default (layout.js:6)
                        at Object.create (ext-all.js:21)
                        at MODx.load (modx.js?v=07eb0c0a:85)
                        at (index):52
                        at ext-all.js:21
                        at b (ext-all.js:21)
                    readState @ modx.js?v=07eb0c0a:938
                    MODx.HttpProvider @ modx.js?v=07eb0c0a:793
                    MODx.Layout @ modx.layout.js:25
                    MODx.Layout.Default @ layout.js:6
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):52
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    ext-all.js:21 Uncaught TypeError: Cannot read property 'request' of undefined
                        at constructor.execute (ext-all.js:21)
                        at constructor.load (ext-all.js:21)
                        at MODx.grid.WhoIsOnline.MODx.grid.Grid [as constructor] (modx.grid.js:115)
                        at new MODx.grid.WhoIsOnline (modx.grid.user.online.js:42)
                        at Object.create (ext-all.js:21)
                        at MODx.load (modx.js?v=07eb0c0a:85)
                        at (index):66
                        at ext-all.js:21
                        at b (ext-all.js:21)
                    execute @ ext-all.js:21
                    load @ ext-all.js:21
                    MODx.grid.Grid @ modx.grid.js:115
                    MODx.grid.WhoIsOnline @ modx.grid.user.online.js:42
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):66
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    ext-all.js:21 Uncaught TypeError: Cannot read property 'request' of undefined
                        at constructor.execute (ext-all.js:21)
                        at constructor.load (ext-all.js:21)
                        at MODx.grid.RecentlyEditedResourcesByUser.MODx.grid.Grid [as constructor] (modx.grid.js:115)
                        at new MODx.grid.RecentlyEditedResourcesByUser (modx.grid.user.recent.resource.js:45)
                        at Object.create (ext-all.js:21)
                        at MODx.load (modx.js?v=07eb0c0a:85)
                        at (index):73
                        at ext-all.js:21
                        at b (ext-all.js:21)
                    execute @ ext-all.js:21
                    load @ ext-all.js:21
                    MODx.grid.Grid @ modx.grid.js:115
                    MODx.grid.RecentlyEditedResourcesByUser @ modx.grid.user.recent.resource.js:45
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):73
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    s.gif:1 GET http://domain.dc.local/manager/undefinedassets/ext3/resources/images/default/s.gif 404 (Not Found)
                    Image (async)
                    render @ ext-all.js:21
                    onRender @ ext-all.js:21
                    render @ ext-all.js:21
                    Ext.Component @ ext-all.js:21
                    S @ ext-base.js:21
                    S @ ext-base.js:21
                    S @ ext-base.js:21
                    S @ ext-base.js:21
                    S @ ext-base.js:21
                    MODx.grid.Grid @ modx.grid.js:94
                    MODx.grid.WhoIsOnline @ modx.grid.user.online.js:42
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):66
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    ext-base.js:21 POST http://domain.dc.local/manager/undefined?action=system/dashboard/widget/feed&feed=news 404 (Not Found)
                    i @ ext-base.js:21
                    request @ ext-base.js:21
                    request @ ext-all.js:21
                    request @ modx.js?v=07eb0c0a:551
                    loadFeed @ modx.panel.welcome.js:48
                    setup @ modx.panel.welcome.js:38
                    MODx.panel.Welcome @ modx.panel.welcome.js:29
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    _loadComponents @ modx.component.js:68
                    MODx.Component @ modx.component.js:10
                    MODx.page.Welcome @ welcome.js:18
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):81
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    modx.window.js:60 Uncaught TypeError: this.mask.addClass is not a function
                        at S.onShow (modx.window.js:60)
                        at S.afterShow (ext-all.js:21)
                        at S.show (ext-all.js:21)
                        at Object.show (ext-all.js:21)
                        at MODx.onAjaxException (modx.js?v=07eb0c0a:122)
                        at h.Event.fire (ext-all.js:21)
                        at Ext.data.Connection.fireEvent (ext-all.js:21)
                        at Ext.data.Connection.handleFailure (ext-all.js:21)
                        at f (ext-base.js:21)
                        at m (ext-base.js:21)
                    onShow @ modx.window.js:60
                    afterShow @ ext-all.js:21
                    show @ ext-all.js:21
                    show @ ext-all.js:21
                    onAjaxException @ modx.js?v=07eb0c0a:122
                    fire @ ext-all.js:21
                    fireEvent @ ext-all.js:21
                    handleFailure @ ext-all.js:21
                    f @ ext-base.js:21
                    m @ ext-base.js:21
                    (anonymous) @ ext-base.js:21
                    setInterval (async)
                    n @ ext-base.js:21
                    i @ ext-base.js:21
                    request @ ext-base.js:21
                    request @ ext-all.js:21
                    request @ modx.js?v=07eb0c0a:551
                    loadFeed @ modx.panel.welcome.js:48
                    setup @ modx.panel.welcome.js:38
                    MODx.panel.Welcome @ modx.panel.welcome.js:29
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    _loadComponents @ modx.component.js:68
                    MODx.Component @ modx.component.js:10
                    MODx.page.Welcome @ welcome.js:18
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):81
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    ext-base.js:21 POST http://domain.dc.local/manager/undefined?action=system/dashboard/widget/feed&feed=security 404 (Not Found)
                    i @ ext-base.js:21
                    request @ ext-base.js:21
                    request @ ext-all.js:21
                    request @ modx.js?v=07eb0c0a:551
                    loadFeed @ modx.panel.welcome.js:48
                    setup @ modx.panel.welcome.js:42
                    MODx.panel.Welcome @ modx.panel.welcome.js:29
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    _loadComponents @ modx.component.js:68
                    MODx.Component @ modx.component.js:10
                    MODx.page.Welcome @ welcome.js:18
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):81
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    modx.window.js:100 Uncaught TypeError: Cannot read property 'removeClass' of undefined
                        at S.onHide (modx.window.js:100)
                        at S.afterHide (ext-all.js:21)
                        at S.hide (ext-all.js:21)
                        at Object.hide (ext-all.js:21)
                        at Object.show (ext-all.js:21)
                        at MODx.onAjaxException (modx.js?v=07eb0c0a:122)
                        at h.Event.fire (ext-all.js:21)
                        at Ext.data.Connection.fireEvent (ext-all.js:21)
                        at Ext.data.Connection.handleFailure (ext-all.js:21)
                        at f (ext-base.js:21)
                    onHide @ modx.window.js:100
                    afterHide @ ext-all.js:21
                    hide @ ext-all.js:21
                    hide @ ext-all.js:21
                    show @ ext-all.js:21
                    onAjaxException @ modx.js?v=07eb0c0a:122
                    fire @ ext-all.js:21
                    fireEvent @ ext-all.js:21
                    handleFailure @ ext-all.js:21
                    f @ ext-base.js:21
                    m @ ext-base.js:21
                    (anonymous) @ ext-base.js:21
                    setInterval (async)
                    n @ ext-base.js:21
                    i @ ext-base.js:21
                    request @ ext-base.js:21
                    request @ ext-all.js:21
                    request @ modx.js?v=07eb0c0a:551
                    loadFeed @ modx.panel.welcome.js:48
                    setup @ modx.panel.welcome.js:42
                    MODx.panel.Welcome @ modx.panel.welcome.js:29
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    _loadComponents @ modx.component.js:68
                    MODx.Component @ modx.component.js:10
                    MODx.page.Welcome @ welcome.js:18
                    create @ ext-all.js:21
                    load @ modx.js?v=07eb0c0a:85
                    (anonymous) @ (index):81
                    (anonymous) @ ext-all.js:21
                    b @ ext-all.js:21
                    setInterval (async)
                    e.delay @ ext-all.js:21
                    (anonymous) @ ext-all.js:21
                    fire @ ext-all.js:21
                    b @ ext-all.js:21
                    
                      *** Not just websites, we also create signage, banners, print, trade show displays and more! ***

                      Sean Kimball CLP, CLS.
                      Technical Director / Sr. Developer | BigBlock Studios
                      ._______________________________________________.
                      Bigblock Studios http://www.bigblockstudios.ca Web site design & development.
                      27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
                      phone/fax: 905-426-5525
                      • 3749
                      • 24,544 Posts
                      It looks like a problem with the widgets, though if the JS modx or modx.grid variables are undefined, it's going to affect a lot of things.

                      Checking the console tab in dev. Tools (Ctrl-shift-i) might offer some clues.
                        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