We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3866 ☆ A M B ☆
    • 350 Posts
    Hi all,

    I'm in the process of setting up a site in Rev 2.2.6 which has two context web and arabic, I've followed the information available from the following resources:

    http://www.multilingual-modx.com/
    http://www.butter.com.hk/blog/posts/2010/08/internationalization-in-modx-revolution.html
    http://designfromwithin.com/blog-webdesign-development/2012/01/12/modx-multilingual-setting-up-babel-and-have-a-website-with-multible-languages/

    And have the following switch gateway plugin in place

    <?php
    if($modx->context->get('key') != "mgr"){
            /* grab the current langauge from the cultureKey request var */
            switch ($_REQUEST['cultureKey']) {
                case 'ar':
                    /* switch the context */
                    $modx->switchContext('arabic');
                    break;
               default:
                case 'en':
                    /* 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']);
        }


    And I'm making use of BabelLinks to toggle between the two contexts, and whilst that works fine in the front end, the error log is suggesting there are a few issues!

     [2013-03-14 18:15:48] [2013-03-14 18:17:35] (ERROR @ /index.php) context for 2 is web
    [2013-03-14 18:17:35] (ERROR @ /index.php) SELECT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `modx_site_content` AS `modResource` WHERE  (  ( modResource.parent IN (2,11,12,13,14,15,21,23,22) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 )  AND `modResource`.`template` = 3 )  ORDER BY publishedon DESC LIMIT 2 
    [2013-03-14 18:17:35] (ERROR @ /index.php) context for 3 is web
    [2013-03-14 18:17:35] (ERROR @ /index.php) SELECT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `modx_site_content` AS `modResource` WHERE  (  ( modResource.parent IN (3,18,19,29,30,31,32,33,34,20,16,17) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 )  AND `modResource`.`template` = 3 )  ORDER BY publishedon DESC LIMIT 2 
    [2013-03-14 18:17:35] (ERROR @ /index.php) context for 6 is web
    [2013-03-14 18:17:35] (ERROR @ /index.php) SELECT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `modx_site_content` AS `modResource` WHERE  (  ( modResource.parent IN (6,53,54,55,46,47,48) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 )  AND `modResource`.`template` = 3 )  ORDER BY publishedon DESC LIMIT 2 
    [2013-03-14 18:17:35] (ERROR @ /index.php) context for 7 is web
    [2013-03-14 18:17:35] (ERROR @ /index.php) SELECT `modResource`.`id`, `modResource`.`type`, `modResource`.`contentType`, `modResource`.`pagetitle`, `modResource`.`longtitle`, `modResource`.`description`, `modResource`.`alias`, `modResource`.`link_attributes`, `modResource`.`published`, `modResource`.`pub_date`, `modResource`.`unpub_date`, `modResource`.`parent`, `modResource`.`isfolder`, `modResource`.`introtext`, `modResource`.`content`, `modResource`.`richtext`, `modResource`.`template`, `modResource`.`menuindex`, `modResource`.`searchable`, `modResource`.`cacheable`, `modResource`.`createdby`, `modResource`.`createdon`, `modResource`.`editedby`, `modResource`.`editedon`, `modResource`.`deleted`, `modResource`.`deletedon`, `modResource`.`deletedby`, `modResource`.`publishedon`, `modResource`.`publishedby`, `modResource`.`menutitle`, `modResource`.`donthit`, `modResource`.`privateweb`, `modResource`.`privatemgr`, `modResource`.`content_dispo`, `modResource`.`hidemenu`, `modResource`.`class_key`, `modResource`.`context_key`, `modResource`.`content_type`, `modResource`.`uri`, `modResource`.`uri_override`, `modResource`.`hide_children_in_tree`, `modResource`.`show_in_tree`, `modResource`.`properties` FROM `modx_site_content` AS `modResource` WHERE  (  ( modResource.parent IN (7,38,56,49,57,58,59,60,61,62,63,64,65,50,51) AND `modResource`.`deleted` = 0 AND `modResource`.`published` = 1 )  AND `modResource`.`template` = 3 )  ORDER BY publishedon DESC LIMIT 2  


    The errors appear when you go from the web (english) context to the arabic context, and continue for .

    I have set up the cultureKeys for both web which is en and arabic which is ar, and also set up site_url, base_url and site_start relevant to each site, however, clearly something isn't quite right.

    Suggestions please smiley

    Many thanks [ed. note: boomerang last edited this post 13 years, 6 months ago.]
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
      • 28042 ☆ A M B ☆
      • 24,524 Posts
        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
        • 3866 ☆ A M B ☆
        • 350 Posts
        Having come back to this fresh in the morning, resolved the problem. I was using a getResources call which had &debug activated, hence the lovely report!

        But thanks for the info Susan, some resources to add to the pot. smiley
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel