Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-19257

Fix PHP warning in CRM_Core_BAO_CustomOption

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.10
    • Fix Version/s: 4.7.11
    • Component/s: Core CiviCRM
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding

      Description

      Just an undefined array, but one that filled up my watchdog logs, so I hunted it down!
      ```
      Warning: in_array() expects parameter 2 to be array, null given in CRM_Core_BAO_CustomOption::getOptionListSelector() (line 147 of /home/jon/local/civicrm-buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Core/BAO/CustomOption.php)
      ```

      This message fires when you have

      • A custom checkbox field;
      • No default value is set for the field;
      • You click "Edit Multiple Choice Options" for that field.

      You'll see the PHP warning in your watchdog log once for each checkbox option you have. PR incoming.

      PR tester: If you have a stock demo site, this is easy to test by changing the input type of "Most important issue" to "checkbox" then selecting "Edit Multiple Choice Options" for that field.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                palantejon Jon K Goldberg
                Reporter:
                palantejon Jon K Goldberg
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: