Skip to content

Commit

Permalink
fix(form): import access restrictions may ignore uuids
Browse files Browse the repository at this point in the history
  • Loading branch information
btry committed Oct 5, 2023
1 parent 09a5f1b commit 9d23d4c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1904,15 +1904,20 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
$input[$key] = $DB->escape($input[$key]);
}

// Do not process theses fields when adding / updating forms
// They will be imported later; see the variable $subItems below
$input2 = $input;
unset($input2['users'], $input2['groups'], $input2['profiles']);

// Add or update the form
$originalId = $input[$idKey];
$item->skipChecks = true;
if ($itemId !== false) {
$input['id'] = $itemId;
$item->update($input);
$input2['id'] = $itemId;
$item->update($input2);
} else {
unset($input['id']);
$itemId = $item->add($input);
unset($input2['id']);
$itemId = $item->add($input2);
}
$item->skipChecks = false;
if ($itemId === false) {
Expand Down

0 comments on commit 9d23d4c

Please sign in to comment.