(model) skip save on migration when defaults lead to inconsistent data, closes https://github.com/opnsense/core/issues/1149

This commit is contained in:
Ad Schellevis 2016-08-21 20:07:39 +02:00
parent daca31be0d
commit cdfc85fde9

View File

@ -559,7 +559,11 @@ abstract class BaseModel
// serialize to config after last migration step, keep the config data static as long as not all
// migrations have completed.
if ($upgradePerfomed) {
$this->serializeToConfig();
try {
$this->serializeToConfig();
} catch (\Exception $e) {
$logger->error("Model ".$class_info->getName() ." can't be saved, skip ( " .$e . " )");
}
}
}
}