digideskio / zotonic

Automatically exported from code.google.com/p/zotonic
0 stars 0 forks source link

mod_menu: 0.6 -> 0.7 endless pivot errors, if menu has several levels #168

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Problem with mod_menu after migrating 0.6->0.7. Endless errors in pivot query 
about mod_menu:

=INFO REPORT==== 8-Apr-2011::10:37:11 ===
[hints] info @ z_pivot_rsc:251  Executing task: 
mod_menu:convert_symbolic_names( [] )

=INFO REPORT==== 8-Apr-2011::10:37:11 ===
DEBUG: mod_menu:168  [{467,[475,469]},
                      {465,[459,463,455,457,458,454,461,569]},
                      {471,[472,473]}]

=INFO REPORT==== 8-Apr-2011::10:37:11 ===
[hints] warning @ z_pivot_rsc:255  Task failed(error:function_clause): 
mod_menu:convert_symbolic_names([])

At line "DEBUG: mod_menu:168 ..." you can see result of function 
get_menu(Context). This is list of tuples [{Item, Childs}].

function_clause occurs on call:
convert_symbolic_names(Ctx)
  menu_names_to_ids(Menu, Ctx)
    menu_names_to_ids([{Item, Childs}|Rest], Context, Acc)
      menu_names_to_ids(Childs, Context, [])
because Childs is a list of integers, not a tuple. So, this code will fail 
forever if any childs exists.

Quick-and-dirty patch attached.

Original issue reported on code.google.com by hellla...@gmail.com on 8 Apr 2011 at 6:52

Attachments:

GoogleCodeExporter commented 8 years ago
Fixed since revision 647bba956da23a61194e3e6f253964a22108a53d 

Original comment by scherpenisse on 16 Jul 2011 at 12:30