We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43899
    • 26 Posts
    I have a 4-language site with Revo2.5.2 and Babel 3.0.0
    After upgrading to Revo2.6.1 the language contexts show a looong timeout for each page while the default web context is working fine.
    After the timeout the pages appear correctly.
    There are no error messages in the manager.
    Clearing cache on Browser, Manage and core/cache and reinstalling Babel didn't help.
    What can I do next to fix this issue?

    Thanks
    Christoph
    • Which routing plugin did you use for the language/context switch?
        • 43899
        • 26 Posts
        I'm not sure what you mean with "plugin".
        I'm using Babel to handle the languages.
        • Something has to switch to the right context. This could be done in a plugin or sometimes in the index.php
            • 43899
            • 26 Posts
            Finally I got what you mean - has been a while I worked on this.

            Here is my gateway plugin:

            <?php
            if($modx->context->get('key') != "mgr"){
            
                    switch ($_REQUEST['cultureKey']) {
                        case 'fr':
                            $modx->switchContext('Francais');
                            break;
                        case 'en':
                            $modx->switchContext('English');
                            break;
                        case 'es':
                            $modx->switchContext('Espagnol');
                            break;
                        default:
                            $modx->switchContext('web');
            /* do nothing because 'web' is default */
                            break;
                }
                /* unset GET var to avoid
                 * appending cultureKey=xy to URLs by other components */
                unset($_GET['cultureKey']);
            }
            • And $_REQUEST['cultureKey'] is set via .htaccess by some rewrite rules.

              Do you use that old .htaccess or the one (renamed from ht.access) of Revo 2.6.1?

              Maybe you could switch to xRouting and remove the gateway plugins. Each context has to get some context settings.

              If you have an own domains for each language, use the following settings:

              base_url: '/'
              http_host: 'your.hostname' (without www. - otherwise you have to change one xrouting system setting)
              site_url: '{url_scheme}{http_host}{base_url}'

              If you use context/language based subfolders use the setup described on https://modx.today/posts/2015/05/using-xrouting-for-multilingual-websites-in-modx
                • 43899
                • 26 Posts
                At the end it was this string in my template that was called with the path containing a culture key
                <script src="js/bootstrap.min.js"></script>

                This was a leftover from ancient experiments and never created problems in MODX prior to 2.5.6
                  • 34009
                  • 5 Posts
                  I have Problems with Babel in Manager Backend since Upgrading to 2.6.5
                  Seems to have to do with the 'OnDocFormPrerender' Event.
                  The Error I get says: Fatal error: Call to a member function get() on array in /home/museum2/www/test.museums.ch/core/cache/includes/elements/modplugin/16.include.cache.php on line 54
                  Checking this line leads me to this line 54 in Babel Plugin:
                  $contextKeys = $babel->getGroupContextKeys($resource->get('context_key'));

                  If I uncheck the System Event OnDocFormPrerender, Backend Manager works, but the Babel Plugin to switch sites is missing. [ed. note: hzuellig last edited this post 5 years, 9 months ago.]