Skip to content

Commit 9d23d4c

Browse files
committed
fix(form): import access restrictions may ignore uuids
1 parent 09a5f1b commit 9d23d4c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

inc/form.class.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,15 +1904,20 @@ public static function import(PluginFormcreatorLinker $linker, $input = [], $con
19041904
$input[$key] = $DB->escape($input[$key]);
19051905
}
19061906

1907+
// Do not process theses fields when adding / updating forms
1908+
// They will be imported later; see the variable $subItems below
1909+
$input2 = $input;
1910+
unset($input2['users'], $input2['groups'], $input2['profiles']);
1911+
19071912
// Add or update the form
19081913
$originalId = $input[$idKey];
19091914
$item->skipChecks = true;
19101915
if ($itemId !== false) {
1911-
$input['id'] = $itemId;
1912-
$item->update($input);
1916+
$input2['id'] = $itemId;
1917+
$item->update($input2);
19131918
} else {
1914-
unset($input['id']);
1915-
$itemId = $item->add($input);
1919+
unset($input2['id']);
1920+
$itemId = $item->add($input2);
19161921
}
19171922
$item->skipChecks = false;
19181923
if ($itemId === false) {

0 commit comments

Comments
 (0)