Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 5df41a5

Browse files
committed
Don't fail upgrade due to integrity constraint violation.
1 parent 2b01824 commit 5df41a5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/controllers/components/UtilityComponent.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,15 @@ public function installModule($moduleName)
643643
}
644644

645645
$moduleDao->setCurrentVersion($version);
646-
$moduleModel->save($moduleDao);
646+
try {
647+
$moduleModel->save($moduleDao);
648+
} catch(Zend_Db_Statement_Exception $e) {
649+
if ($e->getCode() === 23000) {
650+
$this->getLogger()->debug("Failed to install ".$moduleName." due to integrity constraint violation.");
651+
} else {
652+
throw $e;
653+
}
654+
}
647655

648656
if ($uuid === false) {
649657
if (file_exists(BASE_PATH.'/modules/'.$moduleName.'/AppController.php')) {

0 commit comments

Comments
 (0)