Merge pull request #18891 from civicrm/5.31
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 31 Oct 2020 03:02:07 +0000 (14:02 +1100)
committerGitHub <noreply@github.com>
Sat, 31 Oct 2020 03:02:07 +0000 (14:02 +1100)
5.31

CRM/Contact/Form/Search/Custom/FullText.php
templates/CRM/Contact/Form/Search/Custom/FullText.tpl
tests/phpunit/CRM/Core/FormTest.php

index c8ea5961aa3235e76509a6e105610cd995b3c61c..09faca084a55d2e3a89037302cb159991043f034 100644 (file)
@@ -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')];
index 51a3c91956d8b96f243496c06062b4865605cd98..f2bcfdebb169d2202bd1ae94ce1d3bd9b8d8e21a 100644 (file)
     <div class="form-item">
       <table class="form-layout-compressed">
         <tr>
-          <td class="label">{$form.text.label}</td>
-          <td>{$form.text.html}</td>
-          <td class="label">{ts}in...{/ts}</td>
-          <td>{$form.table.html}</td>
+          <td>
+            <label>{$form.text.label}</label>
+            {$form.text.html}
+          </td>
+          <td>
+            <label>{ts}in...{/ts}</label>
+            {$form.table.html}
+          </td>
           <td>{$form.buttons.html} {help id="id-fullText"}</td>
         </tr>
       </table>
index 57bca3e47b272206c08aadaddabef5cc2f4a0e6d..34abdec5bbaa1b43b52de741ad236814ca4de942 100644 (file)
@@ -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);
+        },
+      ],
     ];
   }