Currently, there is an advanced option called "parent item".

Many, many people incorrectly use this option because they think that's the only way to get a sub-tree of the menu they want. So they end up having to create multiple menu blocks for each one of their mis-configured parent items and trying to figure out how to hide the block (with block visibility rules) in order for it to not show up on pages it shouldn't. All their problems would be solved if they used the "starting level" option instead.

The "parent item" option should only be used rarely and its proximity to the "menu" option and its placement above the "starting level" option is deeply problematic.

Comments

johnalbin’s picture

Status: Active » Fixed

The "Parent item" has been renamed "Fixed parent item" and moved to the bottom of the form. The description has also been improved.

Fixed (I hope). http://drupal.org/cvs?commit=495236

Status: Fixed » Closed (fixed)

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

chriscalip’s picture

Title: Improve usability of "Parent item" UI » Improve usability of "Parent item" UI + Panels Integration BUG!
Version: 7.x-2.x-dev » 6.x-2.x-dev
Status: Closed (fixed) » Active
StatusFileSize
new631 bytes

Hey John,

I wanted to give care to our favorite module menu block; saw a bug so i wanted to report and give a patch fix. Well the submit handler for the normal menu_block got updated but not for the associated panels menu block content type "menu tree".

so on /menu_block/plugins/content_types/menu_tree/menu_tree.inc @ function menu_block_content_type_edit_form_submit
add

if (!empty($form_state['values']['parent'])) {
  list($form_state['conf']['menu_name'], $form_state['conf']['parent_mlid']) = explode(':', $form_state['values']['parent']);
}

Looking forward to your decision cause I am also dependent on menu_block's api with the panels_extras sub module seo_menu_title.

chriscalip’s picture

Status: Active » Needs review
asb’s picture

My problem is that the chosen "Fixed parent item" of a 'menu_block' that is embedded in a Panel is not being honored; mybe that's the issue #3 is trying to fix.

The patch from #3 does apply cleanly against menu_block 6.x-2.x-dev from 2011-May-20, if running with the -p0 option:

$ patch -p0 < 1050766.fixed-parent-item.patch 
patching file plugins/content_types/menu_tree/menu_tree.inc

... and it fixes the issue I was experiencing.

Thanks!

asb’s picture

Status: Needs review » Reviewed & tested by the community
dave reid’s picture

Status: Reviewed & tested by the community » Needs work
+++ plugins/content_types/menu_tree/menu_tree.incundefined
@@ -133,6 +133,9 @@ function menu_block_menu_tree_content_type_edit_form_submit(&$form, &$form_state
+      list($form_state['conf']['menu_name'], $form_state['conf']['parent_mlid']) = explode(':', $form_state['values']['parent']);

Indentation needs to be fixed to use two spaces.

chriscalip’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new614 bytes

per #7 updated patch, since its only an indentation recommendation brought back to RTBC

dave reid’s picture

Status: Reviewed & tested by the community » Needs work

Shouldn't this also handle menu blocks saved with the incorrect parent value as per #1209520: Parent menu item not set/retrieved correctly?

joelrotelli’s picture

Thanks a lot for this patch! It's work very well !!!

jojonaloha’s picture

The patch in #8 worked for me as well. Using Drupal 7.12, Panels 7.x-3.2 and Menu Block 7.x-2.3

khiminrm’s picture

The patch in #8 Works fine! Have the same as in #11.

mattiasj’s picture

The patch in #8 works great, thanks!

jweowu’s picture

n.b. For the 7.x-2.x version of the module, there's a similar issue+patch here:
http://drupal.org/node/1203646#comment-6322448

gg4’s picture

Status: Needs work » Needs review

Moving to needs review.

willieseabrook’s picture

I was trying to add a menu block from panels, but the "Fixed parent item" was being ignored and the entire menu tree was being shown.

I confim the patch in #8 works for Drupal 7.15, menu_block-7.x-2.3 and panels-7.x-3.3.

Thank you!

willieseabrook’s picture

Status: Needs review » Reviewed & tested by the community

With 6 confirmations (including myself), it's reasonable to move this to RTBC.

heavy_engineer’s picture

confirmed patch from #8 working on menu_block 7.2-dev. bacon saved.

johnalbin’s picture

Status: Reviewed & tested by the community » Needs work

Per comment #9, this is still "needs work"

cweagans’s picture

Just tested this and it seems to fix the problem.

jojonaloha’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Issue summary: View changes
Status: Needs work » Needs review
StatusFileSize
new1.05 KB

In reply to #9/#19 looking at #1209520: Parent menu item not set/retrieved correctly, comment #2 suggests that was (later) fixed in #1203646: Pane generates illegal choice error when editing

I applied the patch in #8 which fixes the issue for me in Panels. I also tested creating a custom menu block and it appears to work for me. If that part of the issue is still open it would be helpful to document the steps to reproduce.

Attached is the patch in #8 re-rolled for 7.x-2.x

  • Commit 193b23a on 7.x-2.x by Dave Reid:
    Issue #1050766 by chriscalip, jojonaloha | JohnAlbin: Fixed error with...
dave reid’s picture

Status: Needs review » Fixed

Tested and committed #21 to 7.x-2.x.

Status: Fixed » Closed (fixed)

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