CRM-21672 fix intra-rc regression, fatal when deleting participants
[civicrm-core.git] / CRM / Core / Form / Search.php
index dabab8620fea49eee3536dcd815b070033bf7e74..3b3dcda18b6f8d32856cada1508c8b78d3796317 100644 (file)
@@ -203,6 +203,9 @@ class CRM_Core_Form_Search extends CRM_Core_Form {
    * Add generic fields that specify the contact.
    */
   protected function addContactSearchFields() {
+    if (!$this->isFormInViewOrEditMode()) {
+      return;
+    }
     $this->addSortNameField();
 
     $this->_group = CRM_Core_PseudoConstant::nestedGroup();