Menu trail problem

shah_waliuallah - December 31, 2008 - 00:16
Project:Dynamic Persistent Menu
Version:6.x-1.0-beta1
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

warning: Invalid argument supplied for foreach() in /var/www/vhosts/tauheed-sunnat.com/httpdocs/sunnat/sites/all/modules/dynamic_persistent_menu/dynamic_persistent_menu.module on line 112.

line 112

is

foreach($menu['below'] as $menu_item) {

#1

yrocq - December 31, 2008 - 23:08
Status:active» fixed

Fixed in beta 2

#2

Bacteria Man - January 1, 2009 - 00:01

Yann,

Thanks for the quick response and great module.

The latest fix now enables the top (parent) menu items to appear as expected, but clicking a child menu item produces the following error:

warning: in_array() [function.in-array]: Wrong datatype for second argument in /home/www/html/bq/sites/all/modules/dynamic_persistent_menu/dynamic_persistent_menu.module on line 122.

The child menu items do not persist, which is probably related to the above error.

#3

Bacteria Man - January 2, 2009 - 20:10

I should add that my particular menu has 3 levels of links.

Parent
- Child
- - Child

Does Dynamic Persistent Menu support multi-tiered menus? In theory it shouldn't matter if the navigation contains two levels or ten, right?

#4

Bacteria Man - January 5, 2009 - 23:01
Status:fixed» active

Any status on this bug? I know we're just coming off of a holiday week and that it's only been a few days since my last post, but one of my current projects depends on this module working properly. I'm willing to take a look at the issue myself, but I wanted to give the maintainer first crack at it since he's already familiar with the code.

Let me know!

#5

Bacteria Man - January 8, 2009 - 23:33

I spent a couple of hours today debugging this issue, but wasn't able to determine anything conclusive.

Firstly, the $mlid passed to function theme_dynamic_persistent_menu() on line 76 appears to always equals 0 so the if/else condition on line 85 is never true.

Secondly, the menu_set_active_trail() function in the foreach on line 108 doesn't return anything so the $trial array never gets defined, which is causing the aforementioned error on line 122.

  foreach (menu_set_active_trail() as $value) {
    if ($value['mlid']) {
      $trail[] = $value['mlid'];
    }
  }

The net result is that the children menu items are never persistent.

I think this module has excellent potential, but in its present state the 6.x version is completely unusable and should only be considered developmental (not beta.)

Can someone take a look at this issue and offer his/her analysis?

#6

yrocq - January 9, 2009 - 00:55

Bacteria Man : I fixed the error message on line 122. It is in the development release (DRUPAL-6--1 branch). Could you test it on your Drupal ?

#7

Bacteria Man - January 9, 2009 - 01:17

Yann,

I just installed and tested the dev branch, but unfortunately the error still occurs.

Take a look at my notes above. The $trial array doesn't exist, which is why the error at line 122 is occurring.

If it'll help I will send you (via pm) the URL to my dev server.

#8

yrocq - January 9, 2009 - 05:19
Title:Error Message» Menu trail problem

It seems that the problem comme from [#195876] . I commit a workaround in development branch. You'll have to wait the next nightly build or make CVS checkout.

#9

yrocq - January 9, 2009 - 05:20

#10

Bacteria Man - January 9, 2009 - 16:44

Yann,

I just tried the latest build, but $trial is still undefined resulting in the same error at line 122. I didn't see any new code that addressed the problem.

I'm happy to help test or provide assistance. Let me know how you would like to proceed.

Thanks,
John

#11

yrocq - January 9, 2009 - 19:35

I don't think you use the right version. Line 122 is a comment. From which URL did you get the file ?

#12

Bacteria Man - January 10, 2009 - 00:28

Yann,

My bad! Yes, the latest version fixed the issue--nicely done!

I'm wondering what it would take to add a third tier of items. For example:

parent
-child
--child

It would be ideal if the module dynamically supported an unlimited depth, but three is probably the most practical.

After examining the code it should be possible to simply check for children of children. Do you have any suggestions?

#13

yrocq - January 12, 2009 - 19:29
Status:active» fixed

The bug seems fixed, so I close this issue.

Third item level is a new feature request. Could you post a new issue for it ?

Thanks !

#14

Bacteria Man - January 13, 2009 - 03:16

Yes, this issue can be considered fixed.

My client has changed their mind so the display of third level hierarchy is no longer a requirement.

#15

Bacteria Man - January 24, 2009 - 00:55

We just launched a site using Dynamic Persistent Menu: www.sbribioquest.org

The themer did a great job converting the system text to images.

Thanks again for the great module.

#16

System Message - February 7, 2009 - 01:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.