Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.6.6
-
Fix Version/s: 4.7.15
-
Component/s: Core CiviCRM
-
Labels:
-
Versioning Impact:Patch (backwards-compatible bug fixes)
-
Documentation Required?:None
-
Funding Source:Contributed Code
Description
While working on installing a new extension, i have my custom XML file and everything works ok.
However, when I need to upgrade my module through a new XML file (eg. upgrade_4201.xml) so that I can add a new optionvalue for example in an already defined optiongroup (meaning defined/created during installation), this is impossible, because the system expects to find an OptionGroup first and then an optionvalue. At this point system fails to retrieve the optiongroup ID (because it is already created) therefore gives 'critical db error' (which is normal).
My proposal/suggestion is to either return an ID if an OptionGroup already exists during creation OR do a small query to get the optiongroup_id from the optiongroup_name in the CRM/Utils/Migrate/Import.php function.
I've supplied a patch that does the later, runs a query to get the mentioned id
Can someone tell me if the attached patch affects/breaks directly/indirectly anything?