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

    I’m having some troubles, that look like a caching problem when using the One Gateway Plugin. I can’t file a bugreport because the form on modx.com doesn’t budge, so here goes in a forum post.

    Here’s my setup:
    MODx Revolution 2.0.8-pl (traditional)
    MySQL 5.0.77
    PHP 5.2.11
    PDO support: enabled
    on Linux/Apache webhosting

    I’m browsing in Chrome 10 on Windows 7.

    Two domains:
    a.mydomain.com -> MODx is installed here
    b.mydomain.com -> index.php, config.core.php, .htaccess file are copied here as instructed in the FM.

    For now I use two contexts:
    web (contains all stuff for a.mydomain.com)
    web2 (contains all stuff for b.mydomain.com)

    Now according to the One Gateway Plugin documentation, I should be able to create a plugin containing this code:
    <?php
      // Always move to 'web2' context for debugging purposes.
      $modx->switchContext('web2');
    ?>

    and check the box next to ’OnHandleRequest’ in the ’System Events’ tab.

    This works almost as expected... there are some minor problems that I can’t get resolved.

    Here’s what I do:
    1. Clear the cache
    2. Go to http://b.mydomain.com/
    * Result: 404 page not found
    * Expected: The homepage for context ’web2’
    3. Go to http://a.mydomain.com/
    * Result: The homepage for context ’web2’
    4. Go to http://b.mydomain.com/ again
    * Result: Now look at that, now it does show the homepage for context ’web2’

    It looks like if the cache is empty it won’t create a new page if the context was just switched in the ’OnHandleRequest’ System Event.

    Any suggestions how to solve this? (Yes, I know I can just edit the index.php in the folder for b.mydomain.com but that would mean I have to do that for every new domain I create.)