From: Seamus Lee Date: Fri, 29 Nov 2019 08:33:26 +0000 (+1100) Subject: Merge in 5.20 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1ba43e8d0d271e4c3b4d84fb7f519c55329981ab;p=civicrm-core.git Merge in 5.20 --- 1ba43e8d0d271e4c3b4d84fb7f519c55329981ab diff --cc CRM/Contact/Form/Search.php index 6b3978bb86,f62137c658..647bf880d3 --- a/CRM/Contact/Form/Search.php +++ b/CRM/Contact/Form/Search.php @@@ -896,16 -925,11 +909,17 @@@ class CRM_Contact_Form_Search extends C * @throws \CiviCRM_API3_Exception */ protected function loadMetadata() { - // @todo - check what happens if the person does not have 'access civicontribute' - make sure they // can't by pass acls by passing search criteria in the url. - $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]); - $this->addSearchFieldMetadata(['ContributionRecur' => CRM_Contribute_BAO_ContributionRecur::getContributionRecurSearchFieldMetadata()]); + if (self::checkComponentAccess('CiviContribute')) { + $this->addSearchFieldMetadata(['Contribution' => CRM_Contribute_BAO_Query::getSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['ContributionRecur' => CRM_Contribute_BAO_ContributionRecur::getContributionRecurSearchFieldMetadata()]); + } + $this->addSearchFieldMetadata(['Participant' => CRM_Event_BAO_Query::getSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['Membership' => CRM_Member_BAO_Query::getSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['Pledge' => CRM_Pledge_BAO_Query::getSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['PledgePayment' => CRM_Pledge_BAO_Query::getPledgePaymentSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['Grant' => CRM_Grant_BAO_Query::getSearchFieldMetadata()]); + $this->addSearchFieldMetadata(['Case' => CRM_Case_BAO_Query::getSearchFieldMetadata()]); } } diff --cc CRM/Event/Form/Search.php index 10a05187f6,abf22b7a25..5c6a314c46 --- a/CRM/Event/Form/Search.php +++ b/CRM/Event/Form/Search.php @@@ -448,13 -496,16 +448,25 @@@ class CRM_Event_Form_Search extends CRM return ts('Find Participants'); } + /** + * Set the metadata for the form. + * + * @throws \CiviCRM_API3_Exception + */ + protected function setSearchMetadata() { + $this->addSearchFieldMetadata(['Participant' => CRM_Event_BAO_Query::getSearchFieldMetadata()]); + } + + /** + * Set the default form values. + * + * + * @return array + * the default array reference + */ + public function setDefaultValues() { + parent::setDefaultValues(); + return $this->_formValues; + } + }