Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-2735

Config options passed to a module's validateService method may be inconsistent

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None

      Description

      See https://www.blesta.com/forums/index.php?/topic/11154-validateservice-vars-configoptions-keys-inconsistent/

      Someone mentioned that a module's ::validateService method is passed a set of $vars, including $vars['configoptions'], but the configoptions may be a key/value array of option_id => value sometimes, or option_name => value other times. We should investigate to see where this occurs and what the expectation should be, and whether any core plugins are affected.

        Activity

        Hide
        jonathan Jonathan Reissmueller added a comment -

        The discrepancy occurs any time Services::validate() or Services::validateService() methods are called. The expected input is array('label' => value) as defined in CORE-721 "The label and the value of the field will be sent to the module when the service is provisioned..." Presumably the solution is to make all locations conform to this. As for plugins, do you mean modules? If so I imagine it would depend on how the module uses the config options (which only a couple do).

        Show
        jonathan Jonathan Reissmueller added a comment - The discrepancy occurs any time Services::validate() or Services::validateService() methods are called. The expected input is array('label' => value) as defined in CORE-721 "The label and the value of the field will be sent to the module when the service is provisioned..." Presumably the solution is to make all locations conform to this. As for plugins, do you mean modules? If so I imagine it would depend on how the module uses the config options (which only a couple do).
        Hide
        jonathan Jonathan Reissmueller added a comment -

        We will update the core to always submit config options to modules in the [name => value]. We will also update documentation to specify the expected format of config options submitted to it.

        Show
        jonathan Jonathan Reissmueller added a comment - We will update the core to always submit config options to modules in the [name => value] . We will also update documentation to specify the expected format of config options submitted to it.

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            tyson Tyson Phillips (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              18/Jul/18

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 2 hours, 48 minutes
              2h 48m

                Agile