Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove Deprecated Data Source Script Reassociation
This commit removes deprecated code responsible for reassociating data source scripts with the imported script. The functionality should be handled in the data source ProcessExporterExtension file.
  • Loading branch information
sanjacornelius committed Feb 10, 2024
commit 677503b48dce22415b116b89e62bbada22d7d4e9
25 changes: 0 additions & 25 deletions ProcessMaker/ImportExport/Importer.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,38 +48,13 @@ public function doImport($existingAssetInDatabase = null, $importingFromTemplate

$count = count(Arr::where($this->manifest->all(), fn ($exporter) => $exporter->mode !== 'discard'));
$this->logger->log("Importing $count assets");

foreach ($this->manifest->all() as $exporter) {
if ($exporter->mode !== 'discard') {
$this->logger->log('Importing ' . get_class($exporter->model));
if ($exporter->disableEventsWhenImporting) {
$exporter->model->saveQuietly();
} else {
$exporterClass = get_class($exporter->model);
if ($exporterClass === 'ProcessMaker\Packages\Connectors\DataSources\Models\Script') {
switch ($exporter->mode) {
case 'copy':
$exporter->model->script_id = $this->newScriptId;
break;
case 'update':
$script = Script::find($exporter->model->script_id);
if ($script) {
$script->fill($exporter->model->getAttributes());
$script->save();
}
break;

default:
// code...
break;
}
}

$exporter->model->save();

if ($exporterClass === 'ProcessMaker\Models\Script') {
$this->newScriptId = $exporter->model->id;
}
}
$exporter->log('newId', $exporter->model->id);
}
Expand Down