We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46584
    • 29 Posts
    Hi

    I updated from MODx revolution 2.2.14 to 2.3 a couple of days ago and was concerned everything was running very slowly; backend manager actions and frontend rendering pages.
    I had assumed it was a problem with the shared host I was using and checked with them to see if they had any problems and they said no.
    Sometimes they do have problems and they don;t say so and they clear within an hour or so I gave them the benefit of the doubt.

    Now again today the system is still running very slow: about 20-30 seconds to render a page if not in the cache.
    Manager actions, resource/template loading saving taking a good few seconds.

    Error log is also filling up with lots of entries
    [2014-07-18 11:36:37] (ERROR @ /index.php) [OnHandleRequest]1
    [2014-07-18 11:37:05] (ERROR @ /manager/index.php) [OnHandleRequest]1

    Is there a known speed problem with 2.3?
    Does anyone recognize what the errors might mean?

    Have almost reached the point of having to roll back to 2.2.14 from a backup of the website I took a couple of days ago which is not ideal since it means all the work I have done on the website over the the past 2 days I will have to recreate: lots of TVs and MIGX things!
    So it would be good to know if there is a solution to speed up 2.3 and get rid of the errors rather than roll back.

    Any advice?

    thanks

    Ian.




    [ed. note: smashingred last edited this post 9 years, 9 months ago.]
      • 46584
      • 29 Posts
      UPDATE...

      I found the source of some of the errors in my error log

      They were caused by plugins not returning anything.

      e.g. the gateway plugin from Babel needed a couple of returns added - modified shown below.
      (original from here does not have returns http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html)

      <?php
      if($modx->context->get('key') != "mgr"){
                      /* grab the current langauge from the cultureKey request var */
                      switch ($_REQUEST['cultureKey']) {
                          case 'fr':
                              /* switch the context */
                              $modx->switchContext('fr');
                              break;
                          case 'de':
                              /* switch the context */
                              $modx->switchContext('de');
                              break;
                          default:
                              /* Set the default context here */
                              $modx->switchContext('web');
                              break;
                      }
                      /* unset GET var to avoid
                       * appending cultureKey=xy to URLs by other components */
                      unset($_GET['cultureKey']);
      		return;
                  }
      else
      	return;
      


      A couple of other plugins with similar problems seemed to be also sorted by adding in returns on the end.

      I'm guessing this is new requirement of 2.3 since the plugins did not previously flag errors.

      • Can you please detail what Extras you are running? Did you see the list of verified Extras to see if they have been updated and compatible with 2.3? Is your site behind a proxy server? Can it connect to the internet?
          Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
        • You beat me to the punch. This seems to be an issue in 2.3 that Extras that don't return anything will return 1. Not sure where this behaviour came from. Might be worth either getting fixed in 2.3 (which I don't think should be the case) or we let Extras authors know they need to make sure their Extras return something even if it's just return().
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
            • 19872
            • 1,078 Posts
            Quote from: smashingred at Jul 18, 2014, 12:39 PM
            You beat me to the punch. This seems to be an issue in 2.3 that Extras that don't return anything will return 1. Not sure where this behaviour came from. Might be worth either getting fixed in 2.3 (which I don't think should be the case) or we let Extras authors know they need to make sure their Extras return something even if it's just return().

            Hi Jay:

            Until the Extras authors update their extras, how do I enter the information into the snippet code. Take FormIt for example, it has multiple snippets. Do I open each snippet and go to the end of the code for each associated snippet and just type: return() ?

            I've been trying this with FormIt, and I then receive Parse Errors, unexpected this or that when I go to view the resource in the browser.
              • 22840
              • 1,572 Posts
              @jay,

              already tried to help with this post http://forums.modx.com/thread/92200/pdotools-and-modx-2-3-ontvoutputrenderlist-1-error?page=2#dis-post-503631 but it doesn't appear to work ( just so you know whats tried and failed )
                • 19872
                • 1,078 Posts
                Quote from: smashingred at Jul 18, 2014, 12:39 PM
                You beat me to the punch. This seems to be an issue in 2.3 that Extras that don't return anything will return 1. Not sure where this behaviour came from. Might be worth either getting fixed in 2.3 (which I don't think should be the case) or we let Extras authors know they need to make sure their Extras return something even if it's just return().

                In regard to this statement. Is this with Extras that are actually set up in a resource? Or, all installed snippets?
                  • 19872
                  • 1,078 Posts
                  I tried just inserting return; at the end of the FormIt snippet and the resource loaded fine in the browser without any Parse Errors. I have yet to inserting on the remaining FormIt snippets.

                  I don't really know php, so can't help but think randomly inserting return; at the end of each snippet won't adversely affect functionaly of the snippet.
                  • I added return; to the following Plugins:

                    phpThumbOfCacheManager
                    Ace
                    ContextRouter
                    Asset Manager

                    In snippets:

                    migxcalCalendar

                    That stopped the errors. [ed. note: rx2 last edited this post 9 years, 9 months ago.]
                      • 3749
                      • 24,544 Posts
                      I think there is a fix for this coming in the next release.

                      It's only required for snippets and plugins that don't already return a value.

                      Putting either of these at the very end of a snippet or plugin that doesn't already have one should be harmless:

                      return;
                      return '';



                        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