From c64ba95b474361455ee7a7a2fc49c85c4aec2011 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Fri, 30 Oct 2020 17:33:03 -0400 Subject: [PATCH] pass correct parameters --- CRM/Contact/Form/Search/Custom/FullText.php | 6 +----- tests/phpunit/CRM/Core/FormTest.php | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/FullText.php b/CRM/Contact/Form/Search/Custom/FullText.php index c8ea5961aa..09faca084a 100644 --- a/CRM/Contact/Form/Search/Custom/FullText.php +++ b/CRM/Contact/Form/Search/Custom/FullText.php @@ -297,11 +297,7 @@ WHERE t.table_name = 'Activity' AND $config = CRM_Core_Config::singleton(); $form->applyFilter('__ALL__', 'trim'); - $form->add('text', - 'text', - ts('Find'), - TRUE - ); + $form->add('text', 'text', ts('Find'), NULL, TRUE); // also add a select box to allow the search to be constrained $tables = ['' => ts('All tables')]; diff --git a/tests/phpunit/CRM/Core/FormTest.php b/tests/phpunit/CRM/Core/FormTest.php index 57bca3e47b..34abdec5bb 100644 --- a/tests/phpunit/CRM/Core/FormTest.php +++ b/tests/phpunit/CRM/Core/FormTest.php @@ -72,6 +72,14 @@ class CRM_Core_FormTest extends CiviUnitTestCase { $form->_action = CRM_Core_Action::ADD; }, ], + // Also a bit flawed, but catches simple stuff. + 'Fulltext search' => [ + 'CRM_Contact_Form_Search_Custom', + function(CRM_Core_Form $form) { + $form->_action = CRM_Core_Action::BASIC; + $form->set('csid', 15); + }, + ], ]; } -- 2.25.1