We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43288
    • 35 Posts
    I upgraded my 2.2.6 to 2.2.7 with no apparent issues and a clean-ish log, but now, every time I save a document resource, the entire manager page refreshes. Under 2.2.6, after a save I would simply get the transparent "Success! Save successful." popup but the manager would not reload. I also removed now-unused addon packages like group_edit and a few others around the same time, so I won't say with complete certainty that the only difference is the upgrade to 2.2.7.

    This is livable but fairly irritating. I am running under MAMP locally, but if this persists once I push it to the client's site, it will no doubt become even slower and more irritating.

    Any suggestions as to what's going on and what can be done about it?

    Many thanks, watou
      • 40045
      • 534 Posts
      Hey Susan John (lol, sorry...no idea why, seen a picture of a real human in the avatar, didn't look at it really, thought it's sottwell =D),

      I don't have this isseu in my 2.2.7, in what browser are you using the manager? [ed. note: exside last edited this post 11 years ago.]
        • 43288
        • 35 Posts
        Hi! Thanks for replying. (But my name's John smiley

        I am glad that this is not an issue with 2.2.7 for everyone, so there is possibly something I can do about it without waiting for an update.

        I am using Chrome Version 26.0.1410.65 on Mac OS X 10.6.8. I also happens the same way under Safari Version 5.1.8 (6534.58.2) and Firefox 20.0. The full page refresh occurs every time I save any resource, but not when saving elements.

        Any ideas what might be causing this? I only have the very common addons installed, but had group_edit and ShopKeeper installed previously and now removed (but the database tables persist). Otherwise, nothing too fancy that I can see.

        Thanks for any thoughts!
          • 40045
          • 534 Posts
          Thought if it was IE, it could be =D...but I also use the browsers you mentioned an I don't have this issue with any of them.

          I think this is a Javascript issue (extJS), so I would have a look at Firebugs Console an see if there are some errors occuring when saving (and preventing it to finish correctly...because if there's an error, the save button is probably a form/submit button and the native behavior of it is posting something and then reloading the page)...
          • I upgraded all of my Cloud accounts, as well as installing a couple of new ones on my localhost, but none of them are showing this behavior.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 43288
              • 35 Posts
              I get this in the native Javascript console when saving a resource (and choosing "Preserve log upon navigation" in the console settings so the refresh doesn't clear it away):

              Uncaught Error: Too much time spent in unload handler. v8/DateExtension:1
              getTimeOverride v8/DateExtension:1
              Ext.extend.sleep modx.js:185
              (anonymous function) index.php:71
              I


              Which is followed by the browser window refreshing to the URL: http://10.0.1.99:8888/manager/?a=1&{}

              I do not get this uncaught error when saving an element, just the semi-transparent "Success!" message and the browser stays on the current page. I hope someone has an idea what's going on here...

              Thanks,
              watou
                • 43288
                • 35 Posts
                About modx.js, line 185:

                    ,sleep: function(ms) {
                        var s = new Date().getTime();
                        for (var i=0;i < 1e7;i++) {
                            if ((new Date().getTime() - s) > ms){
                                break;
                            }
                        }
                    }
                


                https://github.com/modxcms/revolution/blob/develop/manager/assets/modext/core/modx.js#L182

                Sleep conceptually is supposed to yield the CPU, whereas this version goes into a tight buzz loop creating Date() objects until a certain amount of time passes. That is the opposite of sleep and seems as expensive as possible, soaking the CPU and memory manager, which would explain why the JS engine might complain.

                Is there no better way to achieve the desired result? (See http://stackoverflow.com/questions/951021/what-do-i-do-if-i-want-a-javascript-version-of-sleep)

                watou
                  • 11681
                  • 98 Posts
                  watou2,

                  Please see:

                  http://forums.modx.com/thread/83823/help-error-after-upgrading-modx-rev-from-2-2-6-pl-to-2-2-7-pl-syntax-error-internal-server-error?page=2#dis-post-463394

                  You may have found the reason underlying the behavior reported in several forum threads.
                    I looked just like that in 1964.
                    • 43288
                    • 35 Posts
                    Since this is not a proper implementation of something called sleep, it may be the cause of various client-side problems. But I don't know because the reason I found this was due to my "stupid newbie" mistake.

                    In any case, I think this implementation of sleep should be rewritten (or the need obsoleted altogether), because throwing this uncaught JavaScript exception is surely not intended, and might be leading to other client-side problems like partially rendered trees. I really don't know because I never traced the control flow through the JS code.

                    Thanks for the heads up. I will follow that thread to see if I can lend a useful opinion.

                    watou
                      • 43491
                      • 14 Posts
                      i have same problem in all versions of modx rev
                      2.2.5 2.2.6 and 2.2.7
                      and I thought that it should be :lol:
                      may be its serverside problem? how to fix it?