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

Config option logic rejects field with condition based on multi-select

    Details

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

      Description

      Steps to reproduce:
      1. Create a config option group (e.g. "Logic Group")
      2. Create two dropdown options, each with at least two values (e.g "Option1" with values 'a' and 'b', and "Option2" with values 'c' and 'd')
      3. Configure the logic for that option group and make Option2 value 'd' conditional on Option1 being 'in' a or b (i.e select both of them).
      4. Assign the config option group to a package
      5. Try to order the package with Option2 value d selected
      6. Get the error 'No condition sets were fulfilled to allow the Option2 configurable option. It should not be submitted.'

        Activity

        Hide
        jonathan Jonathan Reissmueller added a comment - - edited

        Possible fix update core/Util/PackageOptions/Logic.php around line 240 add:

                        // Assemble a list of valid values based on id if $condition->value_id is an array
                        if (is_array($condition->value_id)) {
                            $valid_values = [];
                            foreach ($trigger_option->values as $value) {
                                if (in_array($value->id, $condition->value_id) && !empty($value->value)) {
                                    $valid_values[] = $value->value;
                                }
                            }
                            $condition->value = implode(',', $valid_values);
                        }
        
        Show
        jonathan Jonathan Reissmueller added a comment - - edited Possible fix update core/Util/PackageOptions/Logic.php around line 240 add: // Assemble a list of valid values based on id if $condition->value_id is an array if (is_array($condition->value_id)) { $valid_values = []; foreach ($trigger_option->values as $value) { if (in_array($value->id, $condition->value_id) && !empty($value->value)) { $valid_values[] = $value->value; } } $condition->value = implode(',', $valid_values); }

          People

          • Assignee:
            jonathan Jonathan Reissmueller
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              4/May/23

              Agile