Skip to content

Commit

Permalink
Add no-prefetch campaign psuedoconstant
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Aug 11, 2021
1 parent b5e0905 commit 9b97477
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CRM/Contribute/DAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Contribute/Contribution.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:9e26b2d7dbaf18117d12aae5bb1b0378)
* (GenCodeChecksum:b14fa847767daf3723033f41dbca9612)
*/

/**
Expand Down Expand Up @@ -872,6 +872,12 @@ public static function &fields() {
'type' => 'EntityRef',
'label' => ts("Campaign"),
],
'pseudoconstant' => [
'table' => 'civicrm_campaign',
'keyColumn' => 'id',
'labelColumn' => 'title',
'prefetch' => 'FALSE',
],
'add' => '3.4',
],
'creditnote_id' => [
Expand Down
3 changes: 3 additions & 0 deletions CRM/Core/CodeGen/Specification.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,9 @@ public function getField(&$fieldXML, &$fields) {
'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)) {
Expand Down
6 changes: 6 additions & 0 deletions xml/schema/Contribute/Contribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,12 @@
<import>true</import>
<comment>The campaign for which this contribution has been triggered.</comment>
<add>3.4</add>
<pseudoconstant>
<table>civicrm_campaign</table>
<keyColumn>id</keyColumn>
<labelColumn>title</labelColumn>
<prefetch>FALSE</prefetch>
</pseudoconstant>
<html>
<type>EntityRef</type>
<label>Campaign</label>
Expand Down

0 comments on commit 9b97477

Please sign in to comment.