Details
Description
CiviCRM doesn't (or if it does, it hasn't always) deleted fee option groups when the event is deleted.
ie event 75 no longer exists but this line does::
INSERT INTO `civicrm_option_group` (`name`, `title`, `description`, `is_reserved`, `is_active`) VALUES ( 'civicrm_event.amount.75', NULL, NULL, 1, 1);
I believe that the patch below should fix this - but am still unable to get upgrade to complete - for unrelated reasons (class loader) so can't fully confirm
Index: CRM/Upgrade/Incremental/php/FourTwo.php
===================================================================
— CRM/Upgrade/Incremental/php/FourTwo.php (revision 40744)
+++ CRM/Upgrade/Incremental/php/FourTwo.php (working copy)
@@ -128,17 +134,21 @@
return TRUE;
}
+
/**- *
+ *
- Function to create price sets
*/
static function creatPriceSet($daoName, $addTo, $options = array()) {
+
$setParams['title'] = CRM_Core_DAO::getFieldValue($daoName[$addTo[0]][0], $addTo[2], 'title');
$pageTitle = strtolower(CRM_Utils_String::munge($setParams['title'], '_', 245));+ if(empty($pageTitle))
{ + // an event that has been deleted leaves a option group behind - (this may be fixed in later versions?) + // we should probably delete the option group - but at least early exit here as the next line will fatal + return; + }if (!CRM_Core_DAO::getFieldValue('CRM_Price_BAO_Set', $pageTitle, 'id', 'name', true))
{ $setParams['name'] = $pageTitle; }