Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
11 Feb 2009 at 19:08 UTC
Updated:
13 Apr 2009 at 11:40 UTC
Jump to comment: Most recent file
Our check did not count on the case that you might use a non-t callback so
if (!$link_translate || (!empty($item['title']) && ($item['title'] == $item['link_title']))) {
needs a change to
if (!$link_translate || ( ( !empty($item['title']) || $item['title_callback'] != 't' ) && ($item['title'] == $item['link_title']))) {
however this can be simplified because the only case ( !empty($item['title']) || $item['title_callback'] != 't' ) is FALSE when nor the title nor the title callback is specified in hook_menu (and because of that the default t is used) and that's broken code http://drupal.org/node/140311 does not list this as a valid case. So we can drop it and get the simple
if (!$link_translate || ($item['title'] == $item['link_title'])) {
code.
D7 patch and test is forthcoming but as this affects d.o. sprint I am inclined to ask for an exception and get it into D6 quick.
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | menu.inc_.patch | 1.16 KB | webchick |
| #9 | link_title.patch | 1.2 KB | chx |
| #3 | link_title.patch | 1.33 KB | chx |
| link_title.patch | 1.33 KB | chx |
Comments
Comment #1
pwolanin commentedlooks like a reasonable approach, but I'll review in more detail.
Comment #2
drumm+1 works on my test site that uncovered the bug.
Comment #3
chx commentedResubmitting for bot review.
Comment #4
pwolanin commentedpatch applies with offset to D7 also
Comment #5
david straussCould we add a unit test for this?
Comment #6
chx commentedGet http://drupal.org/node/204077 in and then we have it tested. That one produces three fails in blog test without this.
Comment #7
chx commentedComment #8
webchickWhile those comments very accurately describe what the code is doing, I'm sure, they read exactly like "wah wah wah" to someone without internal menu system knowledge. ;)
Let's describe the behaviour that we're testing for here, hm?
Comment #9
chx commentedComment #10
webchickCommitted to HEAD with a couple small grammar fixes.
Setting back to 6.x for consideration.
Comment #11
webchickSorry, here's the patch I used.
Comment #12
gábor hojtsyThanks, committed #11 to Drupal 6 too.