diff --git a/CRM/Donrec/DataStructure.php b/CRM/Donrec/DataStructure.php index ae1731a..4719a2f 100644 --- a/CRM/Donrec/DataStructure.php +++ b/CRM/Donrec/DataStructure.php @@ -21,18 +21,19 @@ class CRM_Donrec_DataStructure { 'style' => 'Inline', 'collapse_display' => 1, 'is_active' => 1, - 'is_multiple' => 1, ); public static $customGroups = array( array( 'name' => 'zwb_donation_receipt', 'title' => 'donation-receipt', 'extends' => 'Contact', + 'is_multiple' => 1, ), array( 'name' => 'zwb_donation_receipt_item', 'title' => 'donation-receipt-item', 'extends' => 'Contribution', + 'is_multiple' => 0, ) ); public static $customFieldDefaults = array( diff --git a/CRM/Donrec/Upgrader.php b/CRM/Donrec/Upgrader.php index 181b721..38ec8fd 100644 --- a/CRM/Donrec/Upgrader.php +++ b/CRM/Donrec/Upgrader.php @@ -513,4 +513,17 @@ public function upgrade_0220() { return TRUE; } + /** + * Upgrade to 2.2: + * - Update zwb_donation_receipt_item custom field group + * @link https://github.com/systopia/de.systopia.donrec/issues/156 + */ + public function upgrade_0230() { + civicrm_api3('CustomGroup', 'get', [ + 'name' => "zwb_donation_receipt_item", + 'api.CustomGroup.create' => ['id' => "\$value.id", 'is_multiple' => 0], + ]); + return TRUE; + } + }