Commit 66dc64bb authored by Rodriguez Nyiringabo's avatar Rodriguez Nyiringabo Committed by Adrien Mbuya Maloba
Browse files

[FIX] Categories: Fix error produced when applying role permissions to...

[FIX] Categories: Fix error produced when applying role permissions to sub-categories with no role selected
parent cfcf3237
Pipeline #606461988 passed with stages
in 8 minutes and 41 seconds
......@@ -301,17 +301,14 @@ if (isset($_REQUEST["save"]) && isset($_REQUEST["name"]) && strlen($_REQUEST["na
$rolesRepo->insertOrUpdateSelectedCategoryRole($categId, $categRoleId, $groupRoleId, $groupId);
}
}
if ($_REQUEST['applyRoles'] == "on") {
if ($_REQUEST['applyRoles'] == "on" && !empty($_REQUEST['rolesToApply'])) {
$rolesRepo->applyRoles($_REQUEST["categId"], $_REQUEST['rolesToApply']);
} else {
$rolesRepo->applyRoles($_REQUEST["categId"], []);
}
$rolesRepo->deleteRolesWithoutParent($_REQUEST["categId"]);
if (isset($_REQUEST["tplGroupContainer"]) && ! empty($_REQUEST["tplGroupContainer"])) {
if (isset($_REQUEST["tplGroupContainer"]) && ! empty($_REQUEST["tplGroupContainer"]) && !empty($_REQUEST["categId"])) {
$categlib->manage_sub_categories($_REQUEST["categId"]);
}
$cookietab = 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment