This comment in menu.module is incorrect. The Navigation block is actually provided by system.module. This should be fixed in 7.x, also.

  foreach ($menus as $name => $title) {
    // Default "Navigation" block is handled by user.module.
    $blocks[$name]['info'] = check_plain($title);

Comments

Anonymous’s picture

Issue tags: +Novice

Tagging as Novice

aloyr’s picture

Assigned: Unassigned » aloyr
aloyr’s picture

Assigned: aloyr » Unassigned
Status: Active » Needs review
StatusFileSize
new604 bytes

fixed the comment on the menu.module file to reflect that the block is provided by system.module

brisho’s picture

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

Component: menu.module » documentation

Switching components.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks!

jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Status: Fixed » Patch (to be ported)

Sounds like it needs a backport to 7.x

Psikik’s picture

Here's the D7 patch.

jhodgdon’s picture

Status: Patch (to be ported) » Needs review
jhodgdon’s picture

Version: 7.x-dev » 8.x-dev
Status: Needs review » Needs work

Ummm... How is this comment even relevant to the code around it? I don't see anything in the code there that is dealing with a 'Navigation' block at all, whether it's in the system or user module????

I'm putting this back to 8.x for consideration. I think probably the comment should just be removed? Here's the code, after the previously-committed patch:

 foreach ($menus as $name => $title) {
    // Default "Navigation" block is handled by system.module.
    $blocks[$name]['info'] = check_plain($title);
    // Menu blocks can't be cached because each menu item can have
    // a custom access callback. menu.inc manages its own caching.
    $blocks[$name]['cache'] = DRUPAL_NO_CACHE;
  }

I don't understand that comment at all????

Oh... So if you go all the way back to Drupal ***5*** menu_block() you can see where it came from:

    foreach ($root_menus as $mid => $title) {
      // Default "Navigation" block is handled by user.module.
      if ($mid != 1) {
        $blocks[$mid]['info'] = $title;
      }
    }

But this check was removed in Drupal 6, hasn't come back in 7/8, and that comment has remained. It really just needs to be gone.

jhodgdon’s picture

tagging for backport

kgoel’s picture

Here is the patch with updated comment for D8 (In menu block sanitizing the title used on the block administration screens.)

kgoel’s picture

D7 patch.

kgoel’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Thanks... but you can't just update a D7 patch on a D8 issue, and it's best to wait until D8 has been fixed anyway... Please read the "multiple versions" section at the bottom of:
http://drupal.org/node/1319154

Regarding the D8 patch, it doesn't follow our coding standards for comments:
http://drupal.org/node/1354#inline

Besides, I don't think we need a comment on that line of code at all (most Drupal developers reading the code know that check_plain is used for sanitizing, so we don't really need a code comment telling us that).

kgoel’s picture

Thanks jhodgdon!

Removed the comment from D8.

kgoel’s picture

Status: Needs work » Needs review
jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

That looks fine for me. Since Dries committed the previous patch, I'll leave this here for a day or two to see if anyone disagrees about the wisdom of removing this (I think totally obsolete) code comment.

jhodgdon’s picture

Version: 8.x-dev » 7.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Seems like no one objected. Committed to 8.x. Needs port to 7.x next. Thanks!

kgoel’s picture

D7 patch.

kgoel’s picture

Status: Patch (to be ported) » Needs review
longwave’s picture

Status: Needs review » Reviewed & tested by the community

Trivial patch.

jhodgdon’s picture

Version: 7.x-dev » 6.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks - committed to 7.x. We should also port this to 6.x.

albert volkman’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new573 bytes

Quick patch to close this issue out.

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Again, this is trivial.

star-szr’s picture

Issue tags: -Novice

Removing novice tag since this just needs a commit now.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again - committed to 6.x.

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