Fullscreen
Loading...
 
Skip to main content

Menu Cookie typing error

Status
Closed
Subject
Menu Cookie typing error
Version
14.x
Category
  • Less than 30-minutes fix
Feature
Menu
Resolution status
Fixed or Solved
Submitted by
GriessbreiLP
Volunteered to solve
Jonny Bradley
Lastmod by
lindon
Rating
(1)
Description

Hello,

I already reported my discovery in the forum. But here again for the formal way.

The problem:
If you want to use the feature "cookie" on a menu, it will not work.

Test Case:
Open up a menus sub structure, click on a link, and the menu is collapsed on the new site.

Reason:
tiki wiki checks if the menu cookie "menu.menu_structure_pageID" is existing and if so, it looks if it is opened or closed.

But, the cookies name is not "menu.menu" but "menu.menus".

Where is the problem:
/lib/menubuilder/menulib.php:468
$ck = getCookie('menu'.$params'id'.'__'.$option'position', 'menu');

should be changed into:
$ck = getCookie('menus_'.$params'id'.'__'.$option'position', 'menu');


Another problem is, that this only works for a flat hierachie (like in the bootstrap menu), but if you want to work properly in all menus, you have to change the else if statement too.
Same file, line 464:
} elseif ($option'type' == 's') {

on every lower level, the option.type is not set. We commented it out, so we have a simple } else { and it works.

Solution

Fixed the second part of this bug report (eliminate checking for option type) with this commitQuestion.

Hopefully fixed the first part in r56665Question

I'm guessing this is fixed and am closing. Please re-open if any issues.

Importance
7
Easy to solve?
7
Priority
49
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
5729
Created
Monday 12 October, 2015 12:41:25 UTC
by GriessbreiLP
LastModif
Thursday 12 November, 2015 03:42:01 UTC


Show PHP error messages