From d5fd18f6587e0e3bdb70e363b1130450e07e7a0b Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 20 Jul 2018 10:47:44 +1200 Subject: [PATCH] Fix regression on case export from recent export fix https://github.com/civicrm/civicrm-core/commit/3b4adc92793dccfa446cf66f0740edb543f110d7 changed the way componentmode is defined It now seems inconsistent --- CRM/Case/Task.php | 2 +- CRM/Core/Form/Task.php | 7 ++++- CRM/Export/Form/Select.php | 2 +- CRM/Export/Form/Select/Case.php | 53 +++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 CRM/Export/Form/Select/Case.php diff --git a/CRM/Case/Task.php b/CRM/Case/Task.php index 956ff16662..954786cde5 100644 --- a/CRM/Case/Task.php +++ b/CRM/Case/Task.php @@ -67,7 +67,7 @@ class CRM_Case_Task extends CRM_Core_Task { self::TASK_EXPORT => array( 'title' => ts('Export cases'), 'class' => array( - 'CRM_Export_Form_Select', + 'CRM_Export_Form_Select_Case', 'CRM_Export_Form_Map', ), 'result' => FALSE, diff --git a/CRM/Core/Form/Task.php b/CRM/Core/Form/Task.php index 41a8912ba2..7eea0555c5 100644 --- a/CRM/Core/Form/Task.php +++ b/CRM/Core/Form/Task.php @@ -56,6 +56,11 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form { */ protected $_componentIds; + /** + * @var int + */ + protected $queryMode; + /** * The array that holds all the case ids * @@ -210,7 +215,7 @@ abstract class CRM_Core_Form_Task extends CRM_Core_Form { * @return int */ public function getQueryMode() { - return CRM_Contact_BAO_Query::MODE_CONTACTS; + return $this->queryMode ?: CRM_Contact_BAO_Query::MODE_CONTACTS; } } diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index a44149c666..af478d4adf 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -526,7 +526,7 @@ FROM {$this->_componentTable} * @return int */ public function getQueryMode() { - return (int) $this->controller->get('component_mode'); + return (int) ($this->queryMode ?: $this->controller->get('component_mode')); } } diff --git a/CRM/Export/Form/Select/Case.php b/CRM/Export/Form/Select/Case.php new file mode 100644 index 0000000000..c95aba984a --- /dev/null +++ b/CRM/Export/Form/Select/Case.php @@ -0,0 +1,53 @@ +