Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2
-
Fix Version/s: 3.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
If you try to create an option value with CRM_Core_OptionValue::addOptionValue() where the option group does not yet exist, the code attempts to create the new option group for you. However, Civi crashes when it gets to an invocation of CRM_Utils_Weight::getDefaultWeight (currently at line 204), because require_once() is never called in that code path.
I enclose a patch, and a PHPUnit test that exposes the issue on the unpatched code.