While updating from 1.9.11 to 2.1, we ran into a bug in tiki-categpermissions.php.
We have a category structure with multiple levels of categories, and assigning to children seemed not to work as intended.
I had a look at the code, and it seems like it only assigns to one level of children, and never checks for more levels of children. I rewrote the code quickly to solve our problem, and attaches the patch I used.
I don't know if this breaks all code guidelines in tw, but it works ;)
--- /tmp/tikiwiki-2.1/tiki-categpermissions.php 2008-07-04 20:33:34.000000000 +0200 +++ tiki-categpermissions.php 2008-10-14 15:35:09.534418860 +0200 @@ -48,11 +48,15 @@ // Process the form to assign a new permission to this category and all children if (isset($_REQUEST['assign_all'])) { + function assign_all_children($userlib, $categlib, $categId) { $userlib->assign_object_permission($_REQUEST['group'], $categId, 'category', $_REQUEST['perm']); $children = $categlib->get_child_categories($categId); foreach ($children as $child) { - $userlib->assign_object_permission($_REQUEST['group'], $child['categId'], 'category', $_REQUEST['perm']); + assign_all_children($userlib, $categlib, $child['categId']); + #$userlib->assign_object_permission($_REQUEST['group'], $child['categId'], 'category', $_REQUEST['perm']); } + } + assign_all_children($userlib, $categlib, $categId); } // Process the form to remove a permission from the category
To help developers solve the bug, we kindly request that you demonstrate your bug on a show2.tiki.org instance. To start, simply select a version and click on "Create show2.tiki.org instance". Once the instance is ready (in a minute or two), as indicated in the status window below, you can then access that instance, login (the initial admin username/password is "admin") and configure the Tiki to demonstrate your bug. Priority will be given to bugs that have been demonstrated on show2.tiki.org.
filename | created | hits | comment | version | filetype | ||
---|---|---|---|---|---|---|---|
No attachments for this item |