We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28042 ☆ A M B ☆
    • 24,524 Posts
    I have always been under the impressions that using getOptions() will use User Settings, Context settings, then System settings, whichever it finds first. In other words, Context settings will override System Settings, and User settings will override Context settings and System Settings.

    Apparently this is not exactly true.

    In one case specifically, involving the Ace plugin, context settings must be specifically checked for.

    With the original Ace code
    $modx->getOption('use_editor')

    will not recognize Context settings. That needs to be changed to
    $modx->controller->context->getOption('use_editor')


    Where do User settings come in here?

    So does this mean that all component creators need to specifically check for User and Context settings instead of using $modx->getOption? Is this explained anywhere in the documentation?

    https://github.com/modxcms/revolution/issues/11347

      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
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      I checked, and User settings do override Context or System settings with either version of getOptions. Very odd that Context settings do not override System Settings as expected. [ed. note: sottwell last edited this post 12 years, 5 months ago.]
        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
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        TinyMCE uses $tiny->context->getOption for some things, and $modx->getOption for others. How is one supposed to know when to use which?
          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