mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
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:
parent
3d44941373
commit
2e13a31722
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue