*/
use Civi\Api4\Mapping;
+use Civi\Api4\Queue;
use Civi\Api4\UserJob;
use Civi\Core\ClassScanner;
use Civi\Core\Event\PreEvent;
$mappingName = Mapping::get(FALSE)->addWhere('id', '=', $event->id)->addSelect('name')->execute()->first()['name'];
UserJob::delete(FALSE)->addWhere('name', '=', 'import_' . $mappingName)->execute();
}
+ if ($event->entity === 'UserJob' && $event->action === 'delete') {
+ Queue::delete(FALSE)->addWhere('name', '=', 'user_job_' . $event->id)->execute();
+ }
}
/**
/**
* Outputs and downloads the csv of outcomes from an import job.
+ * Function is accessed from civicrm/import/outcome path.
*
* This gets the rows from the temp table that match the relevant status
* and output them as a csv.
use Civi\Api4\LocationType;
use Civi\Api4\OpenID;
use Civi\Api4\Phone;
+use Civi\Api4\Queue;
use Civi\Api4\Relationship;
use Civi\Api4\RelationshipType;
use Civi\Api4\UserJob;
CRM_Import_Forms::outputCSV();
}
catch (CRM_Core_Exception_PrematureExitException $e) {
+ UserJob::delete()->addWhere('id', '=', $dataSource->getUserJobID())->execute();
+ $this->assertCount(0, Queue::get()
+ ->addWhere('name', '=', 'user_job_' . $dataSource->getUserJobID())
+ ->execute());
// For now just check it got this far without error.
ob_end_clean();
return;