From 2ee21eaab69e16a180cae457ecf048178324769e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 23 Dec 2015 21:34:41 -0500 Subject: [PATCH] Use addField for basic search form --- CRM/Contact/Form/Search/Basic.php | 6 ++---- CRM/Core/Form/Search.php | 7 +++++++ xml/schema/Core/EntityTag.xml | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Form/Search/Basic.php b/CRM/Contact/Form/Search/Basic.php index 6dfa818867..1c0c5c464d 100644 --- a/CRM/Contact/Form/Search/Basic.php +++ b/CRM/Contact/Form/Search/Basic.php @@ -65,10 +65,9 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { // add select for groups if (!empty($searchOptions['groups'])) { - $this->addSelect('group', array( + $this->addField('group', array( 'entity' => 'group_contact', 'label' => ts('in'), - 'context' => 'search', 'placeholder' => ts('- any group -'), )); } @@ -76,10 +75,9 @@ class CRM_Contact_Form_Search_Basic extends CRM_Contact_Form_Search { if (!empty($searchOptions['tags'])) { // tag criteria if (!empty($this->_tag)) { - $this->addSelect('tag', array( + $this->addField('tag', array( 'entity' => 'entity_tag', 'label' => ts('with'), - 'context' => 'search', 'placeholder' => ts('- any tag -'), )); } diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 56f5db878c..74bbb33c45 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -200,4 +200,11 @@ class CRM_Core_Form_Search extends CRM_Core_Form { return ts('Name'); } + /** + * Explicitly declare the form context for addField(). + */ + public function getDefaultContext() { + return 'search'; + } + } diff --git a/xml/schema/Core/EntityTag.xml b/xml/schema/Core/EntityTag.xml index f0c2b04d21..0539e4ed7e 100644 --- a/xml/schema/Core/EntityTag.xml +++ b/xml/schema/Core/EntityTag.xml @@ -65,7 +65,7 @@ tag_id int unsigned - Tag ID + Tag true FK to civicrm_tag 1.1 -- 2.25.1