Uploaded image for project: 'ColdBox Platform'
  1. COLDBOX-371

Convention to override a module's settings in an application or parent module

    Details

    • Type: New Feature
    • Status: Resolved (View workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0
    • Component/s: Modules
    • Labels:
      None

      Description

      Provide a way for a parent app (or a parent module) to override a module's settings that it is dependent on. If we start thinking of modules as stand-alone libraries that can be uninstalled or reinstalled at any time we don't want to have to modify the core code of someone elses module after we install it to change the settings I want.

      I'm thinking something similar to jQuery where a library will usually have a DEFAULTS object you can override, but you're never expected to install a jQuery plugin and then modify the core code to add your settings.

      Give apps and parent modules a "modules" struct in their settings like how it's stored now, but you could actually declare it in the config. The actual modules settings will be appended to this existing struct.

      /config/ColdBox.cfc or /modules/parentModule/ModuleConfig.cfc

      settings = {
        modules = {
          myModule = {
            settings = {
              settingOverride = 'foobar',
              APIKey = 'abc123',
              extraFeature = true
            }
          }
        }
      };
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                elpete Eric Peterson
                Reporter:
                bradwood Brad Wood
              • Votes:
                2 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: