(dev/core#183) Change temp table naming for search-tasks
authorTim Otten <totten@civicrm.org>
Thu, 14 Jun 2018 23:18:16 +0000 (16:18 -0700)
committerTim Otten <totten@civicrm.org>
Fri, 15 Jun 2018 01:01:06 +0000 (18:01 -0700)
Testing notes - This is a pretty formulaic change.  The main concern is some kind of typo or bad table name causing a
hard-fail.  To control that risk, we just run the code in a facile way:

* Perform a contact search
* Pick some contacts
* Export them

We do this procedure under a few circumstances:

* With the original code
* With a purposefully bad edit (provoking an expected error)
* With the new code

CRM/Contact/Form/Task.php
CRM/Core/Config.php

index 5136641e3b70ee2def7aa92f76e76f650f5c203e..243422f771dcd596326616ef207e7dad3f3ed355 100644 (file)
@@ -150,7 +150,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form {
     $form->assign('taskName', CRM_Utils_Array::value($form->_task, $crmContactTaskTasks));
 
     if ($useTable) {
-      $form->_componentTable = CRM_Core_DAO::createTempTableName('civicrm_task_action', TRUE, $qfKey);
+      $form->_componentTable = CRM_Utils_SQL_TempTable::build()->setCategory('tskact')->setDurable()->setId($qfKey)->getName();
       $sql = " DROP TABLE IF EXISTS {$form->_componentTable}";
       CRM_Core_DAO::executeQuery($sql);
 
index a1b3eb7f307b80caaab00586ba18ae323ca0ee42..c4517d6ca28261e7c27a825a93334e8f1a8880f4 100644 (file)
@@ -390,7 +390,6 @@ class CRM_Core_Config extends CRM_Core_Config_MagicMerge {
       AND (
         TABLE_NAME LIKE 'civicrm_import_job_%'
         OR TABLE_NAME LIKE 'civicrm_export_temp%'
-        OR TABLE_NAME LIKE 'civicrm_task_action_temp%'
         OR TABLE_NAME LIKE 'civicrm_report_temp%'
         OR TABLE_NAME LIKE 'civicrm_tmp_d%'
         )