Skip to content

Commit

Permalink
Merge pull request #1486 from jonasraoni/bugfix/stable-3_3_0/9535-ski…
Browse files Browse the repository at this point in the history
…p-invalid-submission-files

pkp/pkp-lib#9487 Skipped non-conforming setting tables from failing t…
  • Loading branch information
jonasraoni authored Jan 11, 2024
2 parents 0b6b0a9 + 91ae830 commit 91390d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion classes/migration/upgrade/OMPv3_3_0UpgradeMigration.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ private function _settingsAsJSON() {
$this->_toJSON($row, $tableName, ['plugin_name', 'context_id', 'setting_name'], 'setting_value');
});
} else {
Capsule::table($tableName)->where('setting_type', 'object')->get()->each(function ($row) use ($tableName) {
try {
$settings = Capsule::table($tableName, 's')->where('setting_type', 'object')->get(['setting_name', 'setting_value', 's.*']);
} catch (Exception $e) {
error_log("Failed to migrate the settings entity \"{$tableName}\"\n" . $e);
continue;
}
$settings->each(function ($row) use ($tableName) {
$this->_toJSON($row, $tableName, ['setting_name', 'locale'], 'setting_value');
});
}
Expand Down

0 comments on commit 91390d4

Please sign in to comment.