Skip to content

Commit 5f0b47b

Browse files
author
test
committed
Fixed so that version abstraction is taken into account when migration ezflow to landingpage
1 parent e6395ba commit 5f0b47b

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bundle/Command/EzFlowMigrateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
163163

164164
Report::write('Save page as Landing Page');
165165
if (!$dryRun) {
166-
$legacyModel->updateEzPage($legacyPage['id'], $landingPage);
166+
$legacyModel->updateEzPage($legacyPage['id'], $legacyPage['version'], $landingPage);
167167
}
168168
}
169169

lib/Legacy/Model.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function getPages()
4848
return $query->fetchAll();
4949
}
5050

51-
public function updateEzPage($id, $xml)
51+
public function updateEzPage($id, $version, $xml)
5252
{
5353
$update = $this->handler->createUpdateQuery();
5454

@@ -63,9 +63,13 @@ public function updateEzPage($id, $xml)
6363
$update->bindValue('ezlandingpage', null, PDO::PARAM_STR)
6464
)
6565
->where(
66-
$update->expr->eq(
67-
$this->handler->quoteColumn('id', 'ezcontentobject_attribute'),
68-
$update->bindValue($id, null, PDO::PARAM_INT)
66+
$update->expr->lAnd(
67+
$update->expr->eq(
68+
$this->handler->quoteColumn('id', 'ezcontentobject_attribute'),
69+
$update->bindValue($id, null, PDO::PARAM_INT)),
70+
$update->expr->eq(
71+
$this->handler->quoteColumn('version', 'ezcontentobject_attribute'),
72+
$update->bindValue($version, null, PDO::PARAM_INT))
6973
)
7074

7175
);

0 commit comments

Comments
 (0)