Wiki INCLUDE fails to include page when multiple INCLUDEs are on same page
- Status
- Closed
- Subject
- Wiki INCLUDE fails to include page when multiple INCLUDEs are on same page
- Version
- 2.x
- Category
- Usability
- Feature
- Category
- Resolution status
- New
- Submitted by
- mcysys
- Lastmod by
- Landry Bitege
- Rating
- Description
We installed Tiki with version 1.9 and we quickly installed the PluginInclude and starting making extensive use of it. This week, we upgraded to 2.2 and some of the includes stopped working.
After some trial and error, it appears to be the 3rd to 4th include on a page (all pages have the same permissions via categories) that fails. It works for admin, but not the average user.
I took a look at the plugin and found the line
// $text="<b>User $user has no permission to access $page</b><br />";
and uncommented it. The user received the message that they did not have permission.- Solution
After poking around in the code for a bit to see how get_perm_object was used elsewhere, I found user_has_perm_on_object, so I tried swapping out the function:
In wikiplugin_include.php, I changed
$perms = $tikilib->get_perm_object($page, 'wiki page', $data, false);
if ($perms'tiki_p_view' != 'y') {to
if ( ! $tikilib->user_has_perm_on_object($user,$page,'wiki page','tiki_p_view') ) {
Everything now works as it did before the upgrade. I even changed the category to deny access to the user on the included page that was originally and it failed properly.
I don't know if get_perm_object is obsolete or has a bug in it, but user_has_perm_on_object works fine.
- Workaround
- Importance
- 4
- Priority
- 20
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2256
- Created
- Thursday 08 January, 2009 21:26:07 UTC
by Unknown - LastModif
- Tuesday 14 April, 2026 21:32:16 UTC