From 9b97477d6268951a5aa875ecca9e435e3f78cae4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 11 Aug 2021 19:58:19 +1200 Subject: [PATCH] Add no-prefetch campaign psuedoconstant --- CRM/Contribute/DAO/Contribution.php | 8 +++++++- CRM/Core/CodeGen/Specification.php | 3 +++ xml/schema/Contribute/Contribution.xml | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index 25a8b10d19..91ad894806 100644 --- a/CRM/Contribute/DAO/Contribution.php +++ b/CRM/Contribute/DAO/Contribution.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contribute/Contribution.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:9e26b2d7dbaf18117d12aae5bb1b0378) + * (GenCodeChecksum:b14fa847767daf3723033f41dbca9612) */ /** @@ -872,6 +872,12 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO { 'type' => 'EntityRef', 'label' => ts("Campaign"), ], + 'pseudoconstant' => [ + 'table' => 'civicrm_campaign', + 'keyColumn' => 'id', + 'labelColumn' => 'title', + 'prefetch' => 'FALSE', + ], 'add' => '3.4', ], 'creditnote_id' => [ diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index f230088797..30bec91f67 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -456,6 +456,9 @@ class CRM_Core_CodeGen_Specification { 'callback', // Path to options edit form 'optionEditPath', + // Should options for this field be prefetched (for presenting on forms). + // The default is TRUE, but adding FALSE helps when there could be many options + 'prefetch', ]; foreach ($validOptions as $pseudoOption) { if (!empty($fieldXML->pseudoconstant->$pseudoOption)) { diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index b8ac6f0792..8fde13a20f 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -471,6 +471,12 @@ true The campaign for which this contribution has been triggered. 3.4 + + civicrm_campaign
+ id + title + FALSE +
EntityRef -- 2.25.1