From: Coleman Watts Date: Wed, 19 May 2021 15:05:16 +0000 (-0400) Subject: SearchKit - Prevent overwriting SavedSearch.modified_date X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1e0a0433b338f429005075c276643a7626a82c22;p=civicrm-core.git SearchKit - Prevent overwriting SavedSearch.modified_date When saving a search, the modified_date was being overwritten with the old value. --- diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 23135f1ad1..3d3c4f2785 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -362,6 +362,8 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ } $params['modified_id'] = $loggedInContactID; } + // Set by mysql + unset($params['modified_date']); // Flush angular caches to refresh search displays if (isset($params['api_params'])) { diff --git a/CRM/Contact/DAO/SavedSearch.php b/CRM/Contact/DAO/SavedSearch.php index 998baf20fb..2f607703c1 100644 --- a/CRM/Contact/DAO/SavedSearch.php +++ b/CRM/Contact/DAO/SavedSearch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Contact/SavedSearch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:fe46c2b4900f1fdde4a90f4858710fde) + * (GenCodeChecksum:8a25df5165c48a42f0280efe9eb262d5) */ /** @@ -306,6 +306,7 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'html' => [ 'label' => ts("Created By"), ], + 'readonly' => TRUE, 'add' => '5.36', ], 'modified_id' => [ @@ -350,6 +351,7 @@ class CRM_Contact_DAO_SavedSearch extends CRM_Core_DAO { 'entity' => 'SavedSearch', 'bao' => 'CRM_Contact_BAO_SavedSearch', 'localizable' => 0, + 'readonly' => TRUE, 'add' => '5.36', ], 'modified_date' => [ diff --git a/xml/schema/Contact/SavedSearch.xml b/xml/schema/Contact/SavedSearch.xml index a06a794ab1..1be44e62ff 100644 --- a/xml/schema/Contact/SavedSearch.xml +++ b/xml/schema/Contact/SavedSearch.xml @@ -144,6 +144,7 @@ + true 5.36 @@ -185,6 +186,7 @@ When the search was created. true CURRENT_TIMESTAMP + true 5.36