Kunena 6.3.0 released

The Kunena team has announce the arrival of Kunena 6.3.0 [K 6.3.0] in stable which is now available for download as a native Joomla extension for J! 4.4.x/5.0.x/5.1.x. This version addresses most of the issues that were discovered in K 6.2 and issues discovered during the last development stages of K 6.3

This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.

The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.

Question hack for no kunenamenu and itemid=0

More
12 years 4 months ago - 12 years 3 months ago #1 by dyvel
Hi

I have a special case where I have many "subsites" that each have a menulink to a Kunena category. And I wished to display the forum with the "subsite" itemid so the correct modules would be displayed.

This may be a border case, but I had an issue getting itemid=0 when I clicked on a link to a thread. My fix was pretty simple once I found out where to implement the hack.

For others, and my own reference, what I did was in the file: administrator/components/com_kunena/libraries/route.php

in the function: protected static function _getItemID($query)

find
Code:
if (!$Itemid) { $menutype = 'kunenamenu'; $list = self::getMenuItems($menutype); $Itemid = self::findItemID($list, $query); }

and replace with
Code:
if (!$Itemid) { $menutype = 'kunenamenu'; $list = self::getMenuItems($menutype); $Itemid = self::findItemID($list, $query); if (!$Itemid) { // no kunenamenu exists - user may have deleted it on purpose $Itemid = $_GET['Itemid']; } }

EDIT: I have modified my code a bit, to also look in mainmenu for an itemid, and fallback to current itemid
Code:
if (!$Itemid) { $menutype = 'kunenamenu'; $list = self::getMenuItems($menutype); $Itemid = self::findItemID($list, $query); if (!$Itemid) { // no kunenamenu exists - user may have deleted it on purpose $menutype = 'mainmenu'; // now look for one in mainmenu $list = self::getMenuItems($menutype); $Itemid = self::findItemID($list, $query); if (!$Itemid) { // Still no luck finding a menu id, then use current itemid $Itemid = $_GET['Itemid']; } } }

I don't know if this is in fact a bug or design by purpose, but the hack fixed my issue. I have also deleted the kunenamenu as I didn't use it and it was only causing issues with the itemid being redirected to the itemid of the kunenamenu entry menuitem
Last edit: 12 years 3 months ago by dyvel.
The following user(s) said Thank You: C0n, bytekultur

Please Log in or Create an account to join the conversation.

More
12 years 4 months ago #2 by Matias
Actually it's by purpose and probably caused because of limitation in Kunena 1.6 router (it was just a prototype, K2.0 has more powerful router).

Please Log in or Create an account to join the conversation.

More
11 years 11 months ago #3 by bytekultur
I was about to do what you did - go through the whole code and find the problem. Thank you for the solution.

I do not think it's a border case, I see it as very important to consider the current Itemid and unfortunately it's often missing. If it's not intended to always force the current Itemid it should be possible to control this via a parameter for each website.

But this of course is just my opinion and I might not see the greater concept ;-)

Cheers,
Terry

Please Log in or Create an account to join the conversation.

Time to create page: 0.663 seconds