In Civi 5.5.3 (Drupal 7.59) I'm running into an error trying to search for deleted cases. In case search with our without additional parameters set, if I check the "Deleted Cases" box I get an error page (generic HTTP 500 page).
In the system logs I get this:
PHP Fatal error: Undefined class constant 'TASK_DELETE' in /mysite/sites/all/modules/civicrm/CRM/Case/Form/Search.php on line 180, referer: mysite.org/civicrm/case/search?reset=1
I'm unable to replicate this on the Demo site because I could only find a 5.3.1 Demo. There is deleted case bug on 5.3.1 but that is a different behavior and has a fix that has already been implemented in 5.5.3 https://lab.civicrm.org/dev/core/commit/2ff620ae263a6c7430730d9b59261ec2b400b063
I need a little help tracking down why the TASK_DELETE is undefined.
The search works in 4.6.38 and I can see the buildQuickForm function was being re-jiggered in the Search file starting in 4.7. (From 5.0 and up it looks just as it does in 5.5.3)
public function buildQuickForm() {
parent::buildQuickForm();
$this->addSortNameField();
CRM_Case_BAO_Query::buildSearchForm($this);
$rows = $this->get('rows');
if (is_array($rows)) {
if (!$this->_single) {
$this->addRowSelectors($rows);
}
$tasks = CRM_Case_Task::permissionedTaskTitles(CRM_Core_Permission::getPermission());
if (!empty($this->_formValues['case_deleted'])) {
unset($tasks[CRM_Case_Task::TASK_DELETE]);
}
else {
unset($tasks[CRM_Case_Task::RESTORE_CASES]);
}
$this->addTaskMenu($tasks);
}
}
In the Case > Task.php file, I see the TASK_DELETE
class CRM_Case_Task extends CRM_Core_Task {
...
public static function tasks() {
if (!self::$_tasks) {
self::$_tasks = array(
self::TASK_DELETE => array(
'title' => ts('Delete cases'),
'class' => 'CRM_Case_Form_Task_Delete',
'result' => FALSE,
),
...
Is there some formatting error I'm overlooking? Does anyone else get this error?