Loading...
 
Features / Usability

Features / Usability


Categories not showing on Wiki page category listing

posts: 224 Ireland

Hi all,

Using Tiki 1.8.4, I am facing following problem. There seems to be inconsistent display of category items in the category bar at the bottom of each Wiki page. For e.g.: when adding a wiki page '123' to category 'ABC' and also adding file gallery 'XYZ' to the same category 'ABC', then the entry for the file gallery does not show up in the category listing on the wiki page '123'. However, when browing through the category 'ABC' using the category browser then both items are displayed.

The behaviour seems to be erratic, sometimes it works, sometimes it doesn't.

Any ideas what is going on here?

Regards,

pat.

posts: 224 Ireland

I found the problem myself in the get_categoryobjects() function in lib/tikilib.php. This routine contains following snippet:

Copy to clipboard
foreach ($objectcat["data"] as $obj) { $type = $obj["type"]; if (!($this->in_multi_array($obj['name'], $listcat))) { if (isset($typetitles["$type"])) { $listcat["{$typetitles["$type"]}"][] = $obj; } elseif (isset($type)) { $listcat["$type"][] = $obj; } } }


The check to remove duplicates on line 3 is bogus because it can very well be for category objects of different types - e.g. file gallery or wiki page - to have the same name. Name is not a good unique identifier which explains also why the problem wasn't always happening as I didn't have naming conflicts across all categories.

I don't think it is otherwise possible to add duplicate objects of the same name and type to the category tables so I would say this check can be eliminated all together. It works for me anyway.

Corrected code:

Copy to clipboard
foreach ($objectcat["data"] as $obj) { $type = $obj["type"]; if (isset($typetitles["$type"])) { $listcat["{$typetitles["$type"]}"][] = $obj; } elseif (isset($type)) { $listcat["$type"][] = $obj; } }

Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting