Make Phriction policy migration even more robust
We have at least one project with `null` as a viewPolicy. This should get sorted out separately, but make the migration robust against it. Auditors: btrahan
This commit is contained in:
@@ -28,10 +28,14 @@ foreach (new LiskMigrationIterator($table) as $doc) {
|
||||
->executeOne();
|
||||
|
||||
if ($project) {
|
||||
|
||||
$view_policy = nonempty($project->getViewPolicy(), $default_view_policy);
|
||||
$edit_policy = nonempty($project->getEditPolicy(), $default_edit_policy);
|
||||
|
||||
$project_name = $project->getName();
|
||||
echo "Migrating doc $id to project policy $project_name...\n";
|
||||
$doc->setViewPolicy($project->getViewPolicy());
|
||||
$doc->setEditPolicy($project->getEditPolicy());
|
||||
$doc->setViewPolicy($view_policy);
|
||||
$doc->setEditPolicy($edit_policy);
|
||||
$doc->save();
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user