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

    on saving this context plug in:

    <?php
    switch ($modx->getOption(’http_host’)) {
    case ’domain2.tld:80’:
    case ’domain2.tld’:
    // if the http_host is of a specific domain, switch the context
    $modx->switchContext(’domain2.tld’);
    break;
    default:
    // by default, don’t do anything
    break;
    }
    ?>

    The last "?>" is being stripped. To make matters more confusing, this error is only visible when the plug in is reloaded - the "save" function does not show the last tagged to have been stripped on save.

    I’ve tried this on two separate installs, but both are on my server, so it might be worth someone else checking before I file as a bug.

    (Environment: Operating system Linux i686 / MySQL version 5.0.91-community / Apache version 2.2.17 /PHP 5.2.17; browsers tried: Safari and Camino)
      • 5340
      • 1,624 Posts
      ?> is not needed. Your code will work without problems.
        • 37514
        • 178 Posts
        Thanks very much, that seems to be true! Might be worth putting this into the plug in documentation.
          • 3749
          • 24,544 Posts
          Done. smiley
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting