CRM-15225 - Add comment to explain the fix
authorColeman Watts <coleman@civicrm.org>
Wed, 3 Sep 2014 11:12:38 +0000 (12:12 +0100)
committerColeman Watts <coleman@civicrm.org>
Wed, 3 Sep 2014 11:15:44 +0000 (12:15 +0100)
CRM/Core/Form.php

index 837eba3e38768a4200b64c19ee074f28601fac9d..0f13418efbc87837618aa3155ee1687fa3c81cbc 100644 (file)
@@ -1750,6 +1750,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
 
     $this->_chainSelectFields[$settings['control_field']] = $elementName;
 
+    // Passing NULL instead of an array of options
+    // CRM-15225 - normally QF will reject any selected values that are not part of the field's options, but due to a
+    // quirk in our patched version of HTML_QuickForm_select, this doesn't happen if the options are NULL
+    // which seems a bit dirty but it allows our dynamically-popuplated select element to function as expected.
     return $this->add('select', $elementName, $settings['label'], NULL, $settings['required'], $props);
   }