Due to changes from #2327795: Display block if no child menu items, the variable $output now assigned as boolean check result against menu_block_tree_output($tree, $config) || !empty($config['display_empty']), which will always result as 1/0, therefore rendering result simply become 1/0, too.

This patch fix the broken logic by moving the assign value of $output after the logical checking, and so revoke the original rendering result.

Comments

hswong3i created an issue. See original summary.

hswong3i’s picture

Title: Bugfix boken rendering result introduced by #2327795 » Bugfix #2327795: boken rendering result introduced by display_empty
StatusFileSize
new722 bytes

Status: Needs review » Needs work

The last submitted patch, 2: menu_block-fix_display_empty-2820279-2.patch, failed testing.

The last submitted patch, 2: menu_block-fix_display_empty-2820279-2.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review

That error is saying tests are turned on but there are no tests.

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community

The menu was showing 1 as the output, but with this patch is showing the menu again!

Thanks @hswong3i

joelpittet’s picture

Here's a bit of Proof of Concept:
https://3v4l.org/fhNAC

Christopher Riley’s picture

This patch works perfectly, I would like to see it pushed right away.

IckZ’s picture

Thanks a lot! patch is working!

aitala’s picture

This patch seems to fix my issue when I call a block via...

<?php $block = module_invoke('menu_block', 'block_view', $block_delta); print render($block['content']); ?>

Eric

fabianx’s picture

Title: Bugfix #2327795: boken rendering result introduced by display_empty » [Regression] Bugfix #2327795: boken rendering result introduced by display_empty

+1 to RTBC and yes this is a critical regression due to wrong argument order

pcorbett’s picture

+1 to RTBC. Patch works as intended.

anou’s picture

patch in #2 works like a charm. Sorry not to have found it before I found another solution by my self ;-).

I'm adding this sentence for search results: "Menu block is displaying 1 (one) instead of the rendered menu array"

Thanks for the patch.

anou’s picture

Title: [Regression] Bugfix #2327795: boken rendering result introduced by display_empty » [Regression] Bugfix #2327795: broken rendering result introduced by display_empty
broeker’s picture

+1 RTBC works as intended

kmonty’s picture

Status: Reviewed & tested by the community » Needs work

This patch appears to introduce a bug in which hidden ("disabled") menu_items are displayed. I'll try to nail down reproduction steps, but this occurred when disabling a link created with special_menu_items and is apart of a menu displayed via menu_minipanels.

joelpittet’s picture

Status: Needs work » Reviewed & tested by the community

This is a regression fix, the hidden menu items showing may be cache related, some other issue in this module or a core bug. The patch is not menu item specific but block level

Leaving this RTBC until proof of this patch causing that.

gmclelland’s picture

The patch in #2 fixed the problem for me. I was seeing "1" appear where menu items should be.

  • joelpittet committed 03a09f8 on 7.x-2.x authored by hswong3i
    Issue #2820279 by hswong3i: [Regression] Bugfix #2327795: broken...
joelpittet’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, I was given access to co-maintain and have committed this.

Status: Fixed » Closed (fixed)

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