[REF] Add contribution_id field to search using metadata instead of hard codeded...
authorSeamus Lee <seamuslee001@gmail.com>
Sun, 10 May 2020 22:18:10 +0000 (08:18 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 10 May 2020 22:18:10 +0000 (08:18 +1000)
CRM/Contribute/BAO/Query.php
CRM/Contribute/DAO/Contribution.php
xml/schema/Contribute/Contribution.xml

index 8dabd0d8de443113fdfe887861bfe9e82fdbfaec..2925909affaf14afd5ef8c51f6b5735e9bda55eb 100644 (file)
@@ -893,8 +893,10 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
       'receive_date',
       'contribution_cancel_date',
       'contribution_page_id',
+      'contribution_id',
     ];
     $metadata = civicrm_api3('Contribution', 'getfields', [])['values'];
+    $metadata['contribution_id'] = $metadata['id'];
     return array_intersect_key($metadata, array_flip($fields));
   }
 
@@ -960,7 +962,6 @@ class CRM_Contribute_BAO_Query extends CRM_Core_BAO_Query {
     $form->addYesNo('contribution_recurring', ts('Contribution is Recurring?'), TRUE);
 
     $form->addYesNo('contribution_test', ts('Contribution is a Test?'), TRUE);
-    $form->add('number', 'contribution_id', ts('Contribution ID'), ['class' => 'four', 'min' => 1]);
     // Add field for transaction ID search
     $form->addElement('text', 'contribution_trxn_id', ts("Transaction ID"));
     $form->addElement('text', 'contribution_check_number', ts('Check Number'));
index d56ce8b8c62382dc9b6a473a52c04bf38aa26988..8d736f25f108d4ee5de0701162a23160670e9380 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Generated from xml/schema/CRM/Contribute/Contribution.xml
  * DO NOT EDIT.  Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:389ae44affe94e52a14c9c6daa79be1d)
+ * (GenCodeChecksum:0954aa2ae3574927fda6614f14168fc8)
  */
 
 /**
@@ -282,6 +282,9 @@ class CRM_Contribute_DAO_Contribution extends CRM_Core_DAO {
           'entity' => 'Contribution',
           'bao' => 'CRM_Contribute_BAO_Contribution',
           'localizable' => 0,
+          'html' => [
+            'type' => 'Text',
+          ],
         ],
         'contribution_contact_id' => [
           'name' => 'contact_id',
index d2f5593b3de657f5ffd4b7ae7fa1511938f87ed7..ad1656a1be5480a7905127c7597d0235608b9b08 100644 (file)
@@ -14,6 +14,9 @@
     <import>true</import>
     <title>Contribution ID</title>
     <comment>Contribution ID</comment>
+    <html>
+      <type>Text</type>
+    </html>
     <add>1.3</add>
   </field>
   <primaryKey>