We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3677
    • 130 Posts
    I've updated to the latest Revo ver 2.26 and now the site context specific references are not working as expected.
    They seem to be pulling in values that are not associated with the current resource or context at all (cached?).

    My setup uses a gateway plugin to route the page request to the proper context.


    Page is requested: http://www.mysite.com/mypage
    gateway plugin fires onhandleRequest event
    switch ($modx->getOption('http_host')) {
    
    Case statement matches based on hostname, session vars are set, switch to proper site context
    case 'www.mysite.com':
    	$_SESSION['siteName'] = 'Mysite';
    	$_SESSION['state'] = 'Texas';
        $_SESSION['site_url'] = 'http://www.mysite.com';    
    	$modx->switchContext('MySiteGeoState');
    break;



    The Modx resource is loaded http://www.mysite.com/mypage
    Both Tvs and session vars in this resource are sometimes being replaced with values that are not associate with the current context or session.
    These appear to be from other active sessions/resources from a different site context.

    examples of references that get replaced with unexpected values:
    <title>[[*longtitle]]</title>
    <link rel="canonical" href="[[!*relCanonical]]"/>
    <p style="visibility:hidden;">[[!getSessionVar? &sessionVar=`state`]]</p>


    Things I've Already Tried:
    Set DisableGlobalCacheOptions=Yes and cleared cache.
    Adding ! option to sessionVar and tv references.

    I'm pretty sure that I had worked all this out and tested previously on the site contexts. I think something changed with the release update. I was previously running something in the 2.1x versions I believe.

    Any help is appreciated.

    -Brian

      • 3186 ☆ A M B ☆
      • 279 Posts
      Why do you set that sessions? You can put that into context settings for if you don't have it already and you can pull that data everywhere.. In templates/chunks with [[++the_setting_key]] and in PHP with $modx->getOption('the_settings_key').

      And maybe this one could help you (disable your gateway plugin)
      http://modx.com/extras/package/gatewaymanager
        MODX Ambassador (NL) & Professional MODX developer
        Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
        MODX e-commerce solution SimpleCart