From: colemanw Date: Fri, 11 Aug 2023 00:31:03 +0000 (-0400) Subject: Api4 getFields - Fix 'prefetch' boolean which was not a boolean; might as well make... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=baffc20664713892270c668eac242dc91b95c66f;p=civicrm-core.git Api4 getFields - Fix 'prefetch' boolean which was not a boolean; might as well make it a string --- diff --git a/CRM/ACL/DAO/ACL.php b/CRM/ACL/DAO/ACL.php index 388d638e1d..0a9b48d468 100644 --- a/CRM/ACL/DAO/ACL.php +++ b/CRM/ACL/DAO/ACL.php @@ -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', ], diff --git a/CRM/Activity/DAO/Activity.php b/CRM/Activity/DAO/Activity.php index 544e93db8e..dd50f905e4 100644 --- a/CRM/Activity/DAO/Activity.php +++ b/CRM/Activity/DAO/Activity.php @@ -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', ], diff --git a/CRM/Campaign/DAO/CampaignGroup.php b/CRM/Campaign/DAO/CampaignGroup.php index a5482ebce1..ba4bb2bb62 100644 --- a/CRM/Campaign/DAO/CampaignGroup.php +++ b/CRM/Campaign/DAO/CampaignGroup.php @@ -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', ], diff --git a/CRM/Campaign/DAO/Survey.php b/CRM/Campaign/DAO/Survey.php index 7acaf692e8..aa39ac1fe0 100644 --- a/CRM/Campaign/DAO/Survey.php +++ b/CRM/Campaign/DAO/Survey.php @@ -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', ], diff --git a/CRM/Contact/DAO/Group.php b/CRM/Contact/DAO/Group.php index 44f8d410e8..eaf99bed29 100644 --- a/CRM/Contact/DAO/Group.php +++ b/CRM/Contact/DAO/Group.php @@ -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', diff --git a/CRM/Contribute/DAO/Contribution.php b/CRM/Contribute/DAO/Contribution.php index 6fc472c9b2..346800cbba 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: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', ], diff --git a/CRM/Contribute/DAO/ContributionPage.php b/CRM/Contribute/DAO/ContributionPage.php index bf31276951..6cc64df78a 100644 --- a/CRM/Contribute/DAO/ContributionPage.php +++ b/CRM/Contribute/DAO/ContributionPage.php @@ -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', ], diff --git a/CRM/Contribute/DAO/ContributionRecur.php b/CRM/Contribute/DAO/ContributionRecur.php index 21d7c21f09..013862e7e0 100644 --- a/CRM/Contribute/DAO/ContributionRecur.php +++ b/CRM/Contribute/DAO/ContributionRecur.php @@ -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', ], diff --git a/CRM/Core/DAO/ActionSchedule.php b/CRM/Core/DAO/ActionSchedule.php index 8eaa254b91..9e24ae319e 100644 --- a/CRM/Core/DAO/ActionSchedule.php +++ b/CRM/Core/DAO/ActionSchedule.php @@ -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', ], diff --git a/CRM/Event/DAO/Event.php b/CRM/Event/DAO/Event.php index 25bfe86c1b..527c2384cc 100644 --- a/CRM/Event/DAO/Event.php +++ b/CRM/Event/DAO/Event.php @@ -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', ], diff --git a/CRM/Event/DAO/Participant.php b/CRM/Event/DAO/Participant.php index e25c471dd3..dee37a6c53 100644 --- a/CRM/Event/DAO/Participant.php +++ b/CRM/Event/DAO/Participant.php @@ -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', ], diff --git a/CRM/Import/Parser.php b/CRM/Import/Parser.php index f8ec36d4e4..29eb8cb1dc 100644 --- a/CRM/Import/Parser.php +++ b/CRM/Import/Parser.php @@ -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') { diff --git a/CRM/Mailing/DAO/Mailing.php b/CRM/Mailing/DAO/Mailing.php index fd8055ccea..894028116b 100644 --- a/CRM/Mailing/DAO/Mailing.php +++ b/CRM/Mailing/DAO/Mailing.php @@ -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', ], diff --git a/CRM/Member/DAO/Membership.php b/CRM/Member/DAO/Membership.php index ab3cfafbd5..ffe034d2d6 100644 --- a/CRM/Member/DAO/Membership.php +++ b/CRM/Member/DAO/Membership.php @@ -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', ], diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index 024d82db91..f383046651 100644 --- a/CRM/Pledge/DAO/Pledge.php +++ b/CRM/Pledge/DAO/Pledge.php @@ -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', ], diff --git a/Civi/Api4/Service/Spec/SpecFormatter.php b/Civi/Api4/Service/Spec/SpecFormatter.php index efcb8b0d65..56f41d0fa7 100644 --- a/Civi/Api4/Service/Spec/SpecFormatter.php +++ b/Civi/Api4/Service/Spec/SpecFormatter.php @@ -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 diff --git a/xml/schema/ACL/ACL.xml b/xml/schema/ACL/ACL.xml index 8a19fab23a..1e058ab473 100644 --- a/xml/schema/ACL/ACL.xml +++ b/xml/schema/ACL/ACL.xml @@ -117,7 +117,7 @@ CRM_ACL_BAO_ACL::getObjectIdOptions - false + disabled diff --git a/xml/schema/Activity/Activity.xml b/xml/schema/Activity/Activity.xml index bc55111df0..9048aa1085 100644 --- a/xml/schema/Activity/Activity.xml +++ b/xml/schema/Activity/Activity.xml @@ -373,7 +373,7 @@ civicrm_campaign
id title - FALSE + disabled
diff --git a/xml/schema/Campaign/CampaignGroup.xml b/xml/schema/Campaign/CampaignGroup.xml index 317c9ee506..e88fb0a430 100644 --- a/xml/schema/Campaign/CampaignGroup.xml +++ b/xml/schema/Campaign/CampaignGroup.xml @@ -37,7 +37,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Campaign/Survey.xml b/xml/schema/Campaign/Survey.xml index 4ec988168e..3d18daf059 100644 --- a/xml/schema/Campaign/Survey.xml +++ b/xml/schema/Campaign/Survey.xml @@ -54,7 +54,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Contact/Group.xml b/xml/schema/Contact/Group.xml index d97b95dc56..80cfc167a6 100644 --- a/xml/schema/Contact/Group.xml +++ b/xml/schema/Contact/Group.xml @@ -198,7 +198,7 @@ id name title - FALSE + disabled EntityRef @@ -218,7 +218,7 @@ id name title - FALSE + disabled EntityRef diff --git a/xml/schema/Contribute/Contribution.xml b/xml/schema/Contribute/Contribution.xml index 3e7428a1ce..b4247ca675 100644 --- a/xml/schema/Contribute/Contribution.xml +++ b/xml/schema/Contribute/Contribution.xml @@ -480,7 +480,7 @@ civicrm_campaign
id title - FALSE + disabled EntityRef diff --git a/xml/schema/Contribute/ContributionPage.xml b/xml/schema/Contribute/ContributionPage.xml index 025ff82477..c0532859bf 100644 --- a/xml/schema/Contribute/ContributionPage.xml +++ b/xml/schema/Contribute/ContributionPage.xml @@ -501,7 +501,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Contribute/ContributionRecur.xml b/xml/schema/Contribute/ContributionRecur.xml index d15272ffbf..0aae506922 100644 --- a/xml/schema/Contribute/ContributionRecur.xml +++ b/xml/schema/Contribute/ContributionRecur.xml @@ -433,7 +433,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Core/ActionSchedule.xml b/xml/schema/Core/ActionSchedule.xml index 33c105b65d..35b463d16c 100644 --- a/xml/schema/Core/ActionSchedule.xml +++ b/xml/schema/Core/ActionSchedule.xml @@ -392,7 +392,7 @@ civicrm_group
id title - FALSE + disabled EntityRef diff --git a/xml/schema/Event/Event.xml b/xml/schema/Event/Event.xml index c3b4bb8bd4..0d5fcad6cb 100644 --- a/xml/schema/Event/Event.xml +++ b/xml/schema/Event/Event.xml @@ -831,7 +831,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Event/Participant.xml b/xml/schema/Event/Participant.xml index 5d0bd26741..85e09c766c 100644 --- a/xml/schema/Event/Participant.xml +++ b/xml/schema/Event/Participant.xml @@ -287,7 +287,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Mailing/Mailing.xml b/xml/schema/Mailing/Mailing.xml index d6f30e66b9..3a62f47368 100644 --- a/xml/schema/Mailing/Mailing.xml +++ b/xml/schema/Mailing/Mailing.xml @@ -487,7 +487,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Member/Membership.xml b/xml/schema/Member/Membership.xml index bc838f6948..cbc921ceab 100644 --- a/xml/schema/Member/Membership.xml +++ b/xml/schema/Member/Membership.xml @@ -296,7 +296,7 @@ civicrm_campaign
id title - FALSE + disabled diff --git a/xml/schema/Pledge/Pledge.xml b/xml/schema/Pledge/Pledge.xml index 779c60965e..32dfa1a2d7 100644 --- a/xml/schema/Pledge/Pledge.xml +++ b/xml/schema/Pledge/Pledge.xml @@ -351,7 +351,7 @@ civicrm_campaign
id title - FALSE + disabled