Zend Framework

Zend_Navigation does not mark children of active pages.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.9.0
  • Component/s: Zend_Navigation
  • Labels:
    None

Description

When creating a menu with Zend_Navigation, it is currently difficult to simply create a menu of items below the current active page, when the minDepth is greater than the depth of the active page.

echo $this->navigation()->menu()->renderMenu(null, array(
    'minDepth' => 1,
    'maxDepth' => 1,
    'ulClass' => 'navigation white',
    'onlyActiveBranch' => true,
    'renderParents' => false));

This should render a menu of the child pages of the top level of the container, but currently if the active page is one of the root nodes, it will render nothing.

Activity

Hide
Robin Skoglund added a comment -

The fix for this requires modifications to Zend_View_Helper_Menu::_renderDeepestMenu(). Unfortunately, this would break BC, because the rendered output would be different for calls to renderMenu() if minDepth/maxDepth is set.

However, it is a bug, and the fix would most likely make the helper behave more like people expect it would. How do we proceed?

Show
Robin Skoglund added a comment - The fix for this requires modifications to Zend_View_Helper_Menu::_renderDeepestMenu(). Unfortunately, this would break BC, because the rendered output would be different for calls to renderMenu() if minDepth/maxDepth is set. However, it is a bug, and the fix would most likely make the helper behave more like people expect it would. How do we proceed?
Hide
Robin Skoglund added a comment -

Edited code snippet to make it more readable.

Show
Robin Skoglund added a comment - Edited code snippet to make it more readable.
Hide
Dolf Schimmel (Freeaqingme) added a comment -

Fix it for 1.9, and put it in capitals in the migration guide?

Show
Dolf Schimmel (Freeaqingme) added a comment - Fix it for 1.9, and put it in capitals in the migration guide?
Hide
Benjamin Eberlei added a comment -

its a bug, we cant provide backwards compabitilty for bugs

Show
Benjamin Eberlei added a comment - its a bug, we cant provide backwards compabitilty for bugs
Hide
Matthew Weier O'Phinney added a comment -

Agreed with Benjamin and Dolf. The current behavior is considered buggy, so we break BC slightly. All such breaks should include a "migration" chapter in the relevant documentation indicating what the break is, why it occurred, and how to update the code.

Robin – this would not be considered something that falls under feature freeze; if you cannot get it in by feature freeze tomorrow, you can still merge it to the release branch prior to the RC.

Show
Matthew Weier O'Phinney added a comment - Agreed with Benjamin and Dolf. The current behavior is considered buggy, so we break BC slightly. All such breaks should include a "migration" chapter in the relevant documentation indicating what the break is, why it occurred, and how to update the code. Robin – this would not be considered something that falls under feature freeze; if you cannot get it in by feature freeze tomorrow, you can still merge it to the release branch prior to the RC.
Hide
Robin Skoglund added a comment -

I had a feeling that was the case. Good to know. I'll have it fixed before the weekend

Show
Robin Skoglund added a comment - I had a feeling that was the case. Good to know. I'll have it fixed before the weekend
Hide
Robin Skoglund added a comment -

Fixed in r16981.

Show
Robin Skoglund added a comment - Fixed in r16981.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: