Skip to content

Commit eb782c5

Browse files
committed
fix(import-export): sync launchpad screen id/title on import
1 parent aeaabc1 commit eb782c5

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

ProcessMaker/ImportExport/Exporters/ProcessLaunchpadExporter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public function import(): bool
4646
foreach ($this->getDependents('screen') as $dependent) {
4747
$properties = json_decode($this->model->properties, true);
4848
$properties['screen_uuid'] = $dependent->model->uuid;
49+
$properties['screen_id'] = $dependent->model->id;
50+
$properties['screen_title'] = $dependent->model->title;
4951
$this->model->properties = json_encode($properties);
5052
}
5153

tests/Feature/ImportExport/Exporters/ProcessLaunchpadExporterTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,15 @@ public function testImportWithCopy()
116116
$properties = json_decode($newProcess->launchpad->properties, true);
117117
$newSavedSearch1Id = Arr::get($properties, 'tabs.0.idSavedSearch');
118118
$newSavedSearch2Id = Arr::get($properties, 'tabs.1.idSavedSearch');
119+
$cancelScreen = $newProcess->cancelScreen;
119120

120121
$this->assertNotEquals($originalSavedSearch1Id, $savedSearch1->id);
121122
$this->assertEquals($savedSearch1->id, $newSavedSearch1Id);
122123
$this->assertEquals($savedSearch2->id, $newSavedSearch2Id);
124+
$this->assertNotNull($cancelScreen);
125+
$this->assertEquals($cancelScreen->id, Arr::get($properties, 'screen_id'));
126+
$this->assertEquals($cancelScreen->uuid, Arr::get($properties, 'screen_uuid'));
127+
$this->assertEquals($cancelScreen->title, Arr::get($properties, 'screen_title'));
123128

124129
// Re-import the same process.
125130
$importer = new Importer($payload, $options);

0 commit comments

Comments
 (0)