Api4 getFields - Fix 'prefetch' boolean which was not a boolean; might as well make...
authorcolemanw <coleman@civicrm.org>
Fri, 11 Aug 2023 00:31:03 +0000 (20:31 -0400)
committercolemanw <coleman@civicrm.org>
Sun, 20 Aug 2023 14:53:47 +0000 (10:53 -0400)
30 files changed:
CRM/ACL/DAO/ACL.php
CRM/Activity/DAO/Activity.php
CRM/Campaign/DAO/CampaignGroup.php
CRM/Campaign/DAO/Survey.php
CRM/Contact/DAO/Group.php
CRM/Contribute/DAO/Contribution.php
CRM/Contribute/DAO/ContributionPage.php
CRM/Contribute/DAO/ContributionRecur.php
CRM/Core/DAO/ActionSchedule.php
CRM/Event/DAO/Event.php
CRM/Event/DAO/Participant.php
CRM/Import/Parser.php
CRM/Mailing/DAO/Mailing.php
CRM/Member/DAO/Membership.php
CRM/Pledge/DAO/Pledge.php
Civi/Api4/Service/Spec/SpecFormatter.php
xml/schema/ACL/ACL.xml
xml/schema/Activity/Activity.xml
xml/schema/Campaign/CampaignGroup.xml
xml/schema/Campaign/Survey.xml
xml/schema/Contact/Group.xml
xml/schema/Contribute/Contribution.xml
xml/schema/Contribute/ContributionPage.xml
xml/schema/Contribute/ContributionRecur.xml
xml/schema/Core/ActionSchedule.xml
xml/schema/Event/Event.xml
xml/schema/Event/Participant.xml
xml/schema/Mailing/Mailing.xml
xml/schema/Member/Membership.xml
xml/schema/Pledge/Pledge.xml

index 388d638e1d69b3c92d8d60f379ecb1415f3bbfde..0a9b48d468695d736a440e0c03f19bb633e402ed 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/ACL/ACL.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:cccf24b98d7147b2f5e237fcb0a54295)
+ * (GenCodeChecksum:56266204b43a487af7bf9963d23e0556)
  */
 
 /**
@@ -378,7 +378,7 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
           ],
           'pseudoconstant' => [
             'callback' => 'CRM_ACL_BAO_ACL::getObjectIdOptions',
-            'prefetch' => 'false',
+            'prefetch' => 'disabled',
           ],
           'add' => '1.6',
         ],
index 544e93db8eb4c36beaf20138c34856dfecb45174..dd50f905e477396786ecb98578e40168c357e9fe 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Activity/Activity.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5e64c1c4489e9c640f15d3a4877f7331)
+ * (GenCodeChecksum:ffa034666119a99fd35c5cf8955b8ecc)
  */
 
 /**
@@ -890,7 +890,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index a5482ebce115b4fc4b9d9070ca493e8c331ccd2e..ba4bb2bb6270c983b66816f8d1e667b18680c203 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Campaign/CampaignGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5d72f04bf39ff20651ca6e1f59a3fd26)
+ * (GenCodeChecksum:a33ba39795de9f821cfb90cbe83db039)
  */
 
 /**
@@ -167,7 +167,7 @@ class CRM_Campaign_DAO_CampaignGroup extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.3',
         ],
index 7acaf692e8468910b7a7ed96f8bb7401186483c0..aa39ac1fe072f0e4ff93381c1baef3a0030fc0f9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Campaign/Survey.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:79c05054f18c94059ec35314ea6bbef6)
+ * (GenCodeChecksum:189e49f95be8623d4a98ab881ab8f5c6)
  */
 
 /**
@@ -343,7 +343,7 @@ class CRM_Campaign_DAO_Survey extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.3',
         ],
index 44f8d410e8d06ae581ecf51994ac407ca84c1cd6..eaf99bed2985833db089bf3d032e72698ef62b1d 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contact/Group.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:34853e01e303b4fe9111665cc7eb0fb5)
+ * (GenCodeChecksum:81bebe4ba76713e7fb6a39e7710634a4)
  */
 
 /**
@@ -641,7 +641,7 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO {
             'keyColumn' => 'id',
             'labelColumn' => 'title',
             'nameColumn' => 'name',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '2.1',
         ],
@@ -671,7 +671,7 @@ class CRM_Contact_DAO_Group extends CRM_Core_DAO {
             'keyColumn' => 'id',
             'labelColumn' => 'title',
             'nameColumn' => 'name',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'readonly' => TRUE,
           'add' => '2.1',
index 6fc472c9b29f45db8789212cb6fcf5d5d8cc5d7d..346800cbba8ba6671e74158b12bfb641525f4f83 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Contribution.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:4816aa376fc64fa748237d9eb9b68e01)
+ * (GenCodeChecksum:3b056f918193848259b0f2c40a06626c)
  */
 
 /**
@@ -1103,7 +1103,7 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index bf312769510dc8e39689034d4f291624dd56687e..6cc64df78af1deab8b8408708c74d4755d7591c9 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionPage.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:7d36798b74d9cf8912d4b23b5abe2fc8)
+ * (GenCodeChecksum:765f5bf08dbacf12c3d292837d718c39)
  */
 
 /**
@@ -1503,7 +1503,7 @@ class CRM_Contribute_DAO_ContributionPage extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index 21d7c21f09eaad0604f3d603386c9260e029cc51..013862e7e03eed5b28e4e92965b0ff88ab63d7a7 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/ContributionRecur.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:f633ecacb25c131d5a07f8c30a169204)
+ * (GenCodeChecksum:d12951f50f11d6868ebb04fe6f3d9707)
  */
 
 /**
@@ -1018,7 +1018,7 @@ class CRM_Contribute_DAO_ContributionRecur extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '4.1',
         ],
index 8eaa254b913c3f0510acd331716778745213b883..9e24ae319e2b4085ceb247366a4b24b3253d344a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/ActionSchedule.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:32b6b57d782a63565e7b0f17cf53b86c)
+ * (GenCodeChecksum:38a9760142f9745025ef828989f73eec)
  */
 
 /**
@@ -1173,7 +1173,7 @@ class CRM_Core_DAO_ActionSchedule extends CRM_Core_DAO {
             'table' => 'civicrm_group',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index 25bfe86c1b1f8b82c340d49874a06fd0dc066d41..527c2384ccc81b39464d41f94bb6c2e8d242aaaf 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Event.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:de7f278485ab58cbd37475fd20b4246d)
+ * (GenCodeChecksum:bb7ac64bd8f09b5afb145f09baf9f08d)
  */
 
 /**
@@ -2216,7 +2216,7 @@ class CRM_Event_DAO_Event extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index e25c471dd3fbea23ac0fc0ac8a6c5aa287b02ff3..dee37a6c534d465493ec7e3c8172ef3e1350d4cc 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Event/Participant.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:2cc6fce620624d08af9f5f0739a81392)
+ * (GenCodeChecksum:3faebf0fa49dd7b3bf527bd082dd1fb7)
  */
 
 /**
@@ -685,7 +685,7 @@ class CRM_Event_DAO_Participant extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index f8ec36d4e4d92c92dbd96daf94a4e2f56bf14efe..29eb8cb1dcfc36ac5314fef8d09945d7b24481f0 100644 (file)
@@ -1641,7 +1641,7 @@ abstract class CRM_Import_Parser implements UserJobInterface {
       $comparisonValue = $this->getComparisonValue($importedValue);
       return $options[$comparisonValue] ?? 'invalid_import_value';
     }
-    if (!empty($fieldMetadata['FKClassName']) || !empty($fieldMetadata['pseudoconstant']['prefetch'])) {
+    if (!empty($fieldMetadata['FKClassName']) || ($fieldMetadata['pseudoconstant']['prefetch'] ?? NULL) === 'disabled') {
       // @todo - make this generic - for fields where getOptions doesn't fetch
       // getOptions does not retrieve these fields with high potential results
       if ($fieldName === 'event_id') {
index fd8055ccea5b61c0ca8d4330d4563622264a6a68..894028116b85d925e9afdcaaf17c0db83698dc16 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Mailing/Mailing.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b6497d273cd5ec8c044a5b60c6cd5fea)
+ * (GenCodeChecksum:7370dea62ce328244525bac141d7fb62)
  */
 
 /**
@@ -1363,7 +1363,7 @@ class CRM_Mailing_DAO_Mailing extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index ab3cfafbd57b60b07ed54832166f043cdce0f525..ffe034d2d683f7362d92d8aeaa86f16b773d9b18 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Member/Membership.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:231656abeadb1c357ccd404b2c02b495)
+ * (GenCodeChecksum:607cc8bc4dd07d1a87529f923a421937)
  */
 
 /**
@@ -662,7 +662,7 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index 024d82db913f3f5776ff0488ec60d40f00a391a4..f38304665194e62314467cfa2653014430a48eed 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Pledge/Pledge.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:5a6d7ca8c7749e190b667bf47b1d024a)
+ * (GenCodeChecksum:de226da85d80eda7f8ffef798215ad2a)
  */
 
 /**
@@ -878,7 +878,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO {
             'table' => 'civicrm_campaign',
             'keyColumn' => 'id',
             'labelColumn' => 'title',
-            'prefetch' => 'FALSE',
+            'prefetch' => 'disabled',
           ],
           'add' => '3.4',
         ],
index efcb8b0d65f7939ecd20fa570190a6572e70c106..56f41d0fa75fa7fe16dc2b6baa1d5365aa733775 100644 (file)
@@ -68,8 +68,8 @@ class SpecFormatter {
       $field->setLabel($data['html']['label'] ?? NULL);
       $field->setLocalizable($data['localizable'] ?? FALSE);
       if (!empty($data['pseudoconstant'])) {
-        // Do not load options if 'prefetch' is explicitly FALSE
-        if (!isset($data['pseudoconstant']['prefetch']) || $data['pseudoconstant']['prefetch'] === FALSE) {
+        // Do not load options if 'prefetch' is disabled
+        if (($data['pseudoconstant']['prefetch'] ?? NULL) !== 'disabled') {
           $field->setOptionsCallback([__CLASS__, 'getOptions']);
         }
         // These suffixes are always supported if a field has options
index 8a19fab23a4c96ed01f7e934d5b0c5ea9e8d2dc4..1e058ab4732e428696113fec05935188547d6faa 100644 (file)
     </html>
     <pseudoconstant>
       <callback>CRM_ACL_BAO_ACL::getObjectIdOptions</callback>
-      <prefetch>false</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <field>
index bc55111df0fc6dfcf47e90b36846c7a918112eb5..9048aa108506de122e7156a630fad54ec98f0646 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index 317c9ee506014c2168d272726b8fb228c8b55e5a..e88fb0a4304952611110232b81c3310d2a614598 100644 (file)
@@ -37,7 +37,7 @@
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index 4ec988168e71e4ba3526ded7f8c947113d91a124..3d18daf05984ca06c33c79508c9c20937b09145e 100644 (file)
@@ -54,7 +54,7 @@
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index d97b95dc564b9162a1708768199ea82a8c0bfd0f..80cfc167a6739ec09a862b0ce81bc62d4912112c 100644 (file)
       <keyColumn>id</keyColumn>
       <nameColumn>name</nameColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
     <html>
       <type>EntityRef</type>
       <keyColumn>id</keyColumn>
       <nameColumn>name</nameColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
     <html>
       <type>EntityRef</type>
index 3e7428a1cea619f7d75c93928cf11de0bec61294..b4247ca6759497d2a99405529ff2614092c66a6b 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
     <html>
       <type>EntityRef</type>
index 025ff8247786b2ba1aa39d70b79dce8092cc73fa..c0532859bf6e3a8a970780b52ad78f57586578f1 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index d15272ffbf96243043fb3d2c64a8fb8173c315ec..0aae506922d5eaa3f7926a8f68bbbaae63e9a458 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index 33c105b65d4ff148da2dfaa78640610027abbc86..35b463d16cfa55e579af37d172229631ee50bf9a 100644 (file)
       <table>civicrm_group</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
     <html>
       <type>EntityRef</type>
index c3b4bb8bd414e516888e78e0a44162d0bff1a403..0d5fcad6cb535d456cd4c707723676effc745731 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index 5d0bd267410efe60db1a4aedaeae7b5e17c3efa7..85e09c766cefe62a07c00b16cdc0c35f40ab1b08 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index d6f30e66b9026fbc363ce41e01aeb46b8575dd40..3a62f473685249d62ce687fa73309144ef4524f3 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index bc838f694891aa36096198bd2266461fa3c3b388..cbc921ceab8f79213aa527a52935f4ddcad25254 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>
index 779c60965e6511d4763214660bc0217d307fc039..32dfa1a2d730e27dde722d6d6d783ac4b5d86b11 100644 (file)
       <table>civicrm_campaign</table>
       <keyColumn>id</keyColumn>
       <labelColumn>title</labelColumn>
-      <prefetch>FALSE</prefetch>
+      <prefetch>disabled</prefetch>
     </pseudoconstant>
   </field>
   <foreignKey>