From: Eileen McNaughton Date: Sat, 23 Apr 2022 23:44:39 +0000 (+1200) Subject: Stop dropping temp table on finish of contact import job X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=91971b3c2896a8b3d2af4bdab09474cd6565a9f1;p=civicrm-core.git Stop dropping temp table on finish of contact import job This is being done in order to support as-required downloading of output csv from the temp table. (note that viewing the temp table directly rather than down loading might also be on the cards) --- diff --git a/CRM/Contact/Import/Form/Preview.php b/CRM/Contact/Import/Form/Preview.php index b65467c144..f6192e02df 100644 --- a/CRM/Contact/Import/Form/Preview.php +++ b/CRM/Contact/Import/Form/Preview.php @@ -290,7 +290,7 @@ class CRM_Contact_Import_Form_Preview extends CRM_Import_Form_Preview { //hack to clean db //if job complete drop table. - $importJob->isComplete(TRUE); + $importJob->isComplete(); } } diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index b21391fd0e..4b11b5b1fb 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -107,15 +107,6 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Form_Summary { * Clean up the import table we used. */ public function postProcess() { - $dao = new CRM_Core_DAO(); - $db = $dao->getDatabaseConnection(); - - $importTableName = $this->get('importTableName'); - // do a basic sanity check here - if (strpos($importTableName, 'civicrm_import_job_') === 0) { - $query = "DROP TABLE IF EXISTS $importTableName"; - $db->query($query); - } } } diff --git a/CRM/Contact/Import/ImportJob.php b/CRM/Contact/Import/ImportJob.php index 838ee5ce83..d11a13f8a0 100644 --- a/CRM/Contact/Import/ImportJob.php +++ b/CRM/Contact/Import/ImportJob.php @@ -84,12 +84,12 @@ class CRM_Contact_Import_ImportJob { } /** - * @param bool $dropIfComplete + * Has the job completed. * * @return bool * @throws Exception */ - public function isComplete($dropIfComplete = TRUE) { + public function isComplete() { if (!$this->_statusFieldName) { throw new CRM_Core_Exception("Could not get name of the import status field"); } @@ -99,10 +99,6 @@ class CRM_Contact_Import_ImportJob { if ($result->fetch()) { return FALSE; } - if ($dropIfComplete) { - $query = "DROP TABLE $this->_tableName"; - CRM_Core_DAO::executeQuery($query); - } return TRUE; }