Skip to content

Commit

Permalink
Merge pull request #23291 from eileenmcnaughton/import_output
Browse files Browse the repository at this point in the history
dev/core#3414 Stop dropping temp table on finish of contact import job
  • Loading branch information
demeritcowboy authored Apr 27, 2022
2 parents 90ab56f + 91971b3 commit ecbc16a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CRM/Contact/Import/Form/Preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function postProcess() {

//hack to clean db
//if job complete drop table.
$importJob->isComplete(TRUE);
$importJob->isComplete();
}

}
9 changes: 0 additions & 9 deletions CRM/Contact/Import/Form/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,6 @@ public function preProcess() {
* 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);
}
}

}
8 changes: 2 additions & 6 deletions CRM/Contact/Import/ImportJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public function getTableName() {
}

/**
* @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");
}
Expand All @@ -104,10 +104,6 @@ public function isComplete($dropIfComplete = TRUE) {
if ($result->fetch()) {
return FALSE;
}
if ($dropIfComplete) {
$query = "DROP TABLE $this->_tableName";
CRM_Core_DAO::executeQuery($query);
}
return TRUE;
}

Expand Down

0 comments on commit ecbc16a

Please sign in to comment.