protected $_openedPanes = [];
+ public function __construct($state = NULL, $action = CRM_Core_Action::NONE, $method = 'post', $name = NULL) {
+ parent::__construct($state, $action, $method, $name);
+ // Because this is a static variable, reset it in case it got changed elsewhere.
+ // Should only come up during unit tests.
+ // Note the only subclass that seems to set this does it in preprocess (custom searches)
+ self::$_selectorName = 'CRM_Contact_Selector';
+ }
+
/**
* Explicitly declare the entity api name.
*/
}
}
if (($mappingType == 'Search Builder') || ($exportMode == CRM_Export_Form_Select::GRANT_EXPORT)) {
- if (CRM_Core_Permission::check('access CiviGrant')) {
+ if (method_exists('CRM_Grant_BAO_Grant', 'exportableFields') && CRM_Core_Permission::check('access CiviGrant')) {
$fields['Grant'] = CRM_Grant_BAO_Grant::exportableFields();
unset($fields['Grant']['grant_contact_id']);
if ($mappingType == 'Search Builder') {
ob_end_clean();
}
+ public function testOpeningSearchBuilder(): void {
+ $_SERVER['REQUEST_URI'] = 'civicrm/contact/search/builder?reset=1';
+ $_GET['q'] = 'civicrm/contact/search/builder';
+ $_GET['reset'] = 1;
+
+ $item = CRM_Core_Invoke::getItem([$_GET['q']]);
+ ob_start();
+ CRM_Core_Invoke::runItem($item);
+ $contents = ob_get_clean();
+
+ unset($_GET['reset']);
+ $this->assertRegExp('/form.+id="Builder" class="CRM_Contact_Form_Search_Builder/', $contents);
+ }
+
}