We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31104
    • 108 Posts
    I have a fresh install with no plugins or content at all, the first thing I'm trying to do is install Babel.

    The problem
    I can create the gateway plugin just fine but as soon as I check the "OnHandleRequest" event, the manager and frontend break and all I can see is the dreaded "white screen", and get no errors registered in the log.

    What I've tried

    • I've changed compress_css (js) to 0 in system settings
    • re-running setup as upgrade
    • re-downloading and reinstalling modx from scratch (many times) via wget and ftp
    • deleting the cache folder via ssh

    But nothing... The only way I can get the manager back is by deleting the "OnHandleRequest" via phpMyAdmin.

    I've installed and used Babel on multiple websites on this same server without any problems (on previous versions of Modx), could this be a possible 2.3.2 bug?

    Has anybody else ran into this? The way to reproduce the error is simply creating the gateway plugin and giving it the "OnHandleRequest".

    Thanks for any help or insights given

    Apache Version 2.2.27
    PHP Version 5.4.31
    MySQL Version 5.5.40-MariaDB
    Operating System linux
    Architecture x86_64

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

    [ed. note: upiorz last edited this post 10 years ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Indeed. Upon creating the active plugin the Manager it immediately crashes the Manager. I was working from the SEO-Friendly version of the documentation here http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html

      I get this PHP error in my server error logs:
      [29-Nov-2014 10:10:25 Asia/Jerusalem] PHP Parse error:  syntax error, unexpected 'more' (T_STRING) in /Applications/MAMP/htdocs/babel/core/cache/includes/elements/modplugin/1.include.cache.php on line 18
      

      Somehow copy/pasting the code has a bit of text inserted into it:
      <?php
      if($modx->context->get('key') != "mgr"){
          /* grab the current langauge from the cultureKey request var */
          switch ($_REQUEST['cultureKey']) {
              case 'en':
                  /* switch the context */
                  $modx->switchContext('en');
                  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']);
      }
      - See more at: http://www.multilingual-modx.com/blog/2011/seo-friendly-multilingual-websites-with-modx-and-babel.html#sthash.t6PwGVw0.dpuf


      What is really strange about this is that the extra text does not appear anywhere in the page source. This also occurs with the plugin code supplied on the original page - http://www.multilingual-modx.com/blog/2011/multilingual-websites-with-modx-and-babel.html
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        My guess is that it's supposed to provide a link, probably using some Javascript, and it got inserted into the wrong container.
          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
          • 31104
          • 108 Posts
          Hello Susan, thank you for the response. Do you mean the "See more at: -----" bit at the end? ... I did notice that and removed it along with the comments on my first attempt, so, sadly that can't be it sad

          Last night I also worked on a different site - on a different host (sky toaster) - and it worked perfectly fine (also Revo 2.3.2). So it's not a modx bug, it has to be related to my server.

          So here's my new dilemma:

          - I can create OnHandleRequest events on this server without any problems as long as I'm working on a non 2.3.x version of Modx

          What could have changed on the latest version of Revo in relation with OnHandleRequests that needs changes (fixes) to be done on my server? (does this make any sense?).

          Should I post this in a different section of the forums?

          Thanks again for your kind reply.

            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Did you completely remove the core/cache directory? I had to do that before the fix to the plugin worked.
              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
              • 31104
              • 108 Posts
              Yes sadly I had sad thanks again, I'll probably try the other option you gave me, I'll look into it later tonight.

                • 31104
                • 108 Posts
                I had a look at langRouter and it looks and works great thanks for the tip Susan!

                Somehow I can only see your post referring to langRouter in my mail but not here in the thread. Did you delete it? I'd like to mark it as the answer.
                • discuss.answer
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  I moved it to another thread, since in effect it was hijacking your thread. The plugin provided on the Babel documentation should also work fine, I've just never used it so cannot really say how to fix any problems with it.

                  The relevant part was a reference to this https://gist.github.com/gadamiak/3812853 with a full discussion of its use here https://forums.modx.com/thread/95280/adventures-with-babel-3-0-0-beta1 and a demo site including the modified version of the LangRouter plugin I use here http://babel.sottwell.modxcloud.com
                    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
                    • 31104
                    • 108 Posts
                    Indeed Babel did it's job just fine on another server I'm working on (with 2.3.2), but for some reason it didn't like this new site I was working on, so by changing the plugin it seemed to clear out the quirk.

                    [ed. note: upiorz last edited this post 10 years ago.]
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Could be a PHP version issue, or even a MySQL version issue. Those can be hard to track down sometimes, although usually the server error logs will give at least some clues. It could also be some kind of mod_security or other restrictive server configuration. Some servers are configured to refuse requests if you send too many within a short period of time, and MODX uses a lot of AJAX requests (although that should only effect the Manager). Anyway, some servers just don't play well with MODX.
                        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