CustomGroup - Add pseudoconstant for extends column
authorColeman Watts <coleman@civicrm.org>
Mon, 20 Dec 2021 05:54:52 +0000 (00:54 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 20 Dec 2021 14:30:53 +0000 (09:30 -0500)
CRM/Core/DAO/CustomGroup.php
tests/phpunit/api/v3/ACLCachingTest.php
xml/schema/Core/CustomGroup.xml

index 70015686b6d402adcd0da80ceb5891bc50b7e9a6..02989e424adba16454db38fc3a12318c9122bf14 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Core/CustomGroup.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:e06fe97917806daa0d337c43968ccf2b)
+ * (GenCodeChecksum:27a1b80ba9d2696e97dd1df33468caff)
  */
 
 /**
@@ -291,6 +291,9 @@ class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
           'entity' => 'CustomGroup',
           'bao' => 'CRM_Core_BAO_CustomGroup',
           'localizable' => 0,
+          'pseudoconstant' => [
+            'callback' => 'CRM_Core_SelectValues::customGroupExtends',
+          ],
           'add' => '1.1',
         ],
         'extends_entity_column_id' => [
index aada6e13568de97d33545f38811c73d2f57e4751..367d5beec6c6fc9676d506f2e68760af09be8eaf 100644 (file)
@@ -49,7 +49,7 @@ class api_v3_ACLCachingTest extends CiviUnitTestCase {
     $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
     $this->assertTrue($values['count'] == 0);
     $this->CustomGroupCreate(['extends' => 'Activity']);
-    $groupCount = $this->callAPISuccess('custom_group', 'getcount', ['extends' => 'activity']);
+    $groupCount = $this->callAPISuccess('custom_group', 'getcount', ['extends' => 'Activity']);
     $this->assertEquals($groupCount, 1, 'one group should now exist');
     $values = $this->callAPISuccess('custom_field', 'getoptions', ['field' => 'custom_group_id']);
     $this->assertEquals(1, $values['count'], 'check that cached value is not retained for custom_group_id');
index c3f52a844172743f1d0fdbd98ef653b15dcb1e24..d65d9c1ee85ffc8c819b0ec4227246529587ed1b 100644 (file)
@@ -51,6 +51,9 @@
     <default>'Contact'</default>
     <comment>Type of object this group extends (can add other options later e.g. contact_address, etc.).</comment>
     <add>1.1</add>
+    <pseudoconstant>
+      <callback>CRM_Core_SelectValues::customGroupExtends</callback>
+    </pseudoconstant>
   </field>
   <field>
     <name>extends_entity_column_id</name>