How To Report Bug in Drupal Core?

Events happening in the community are now at Drupal community events on www.drupal.org.
BruceDawson's picture

I think I finally isolated a bug in drupal 7 core. Here's the "fix" (from directory 'includes'):

*** menu.inc.orig 2014-04-16 17:44:34.000000000 -0400
--- menu.inc 2014-07-07 16:45:01.468028987 -0400


*** 774,780 ****
}
for ($i = 0; $i < $router_item['number_parts']; $i++) {
if ($link_map[$i] == '%') {
! $link_map[$i] = $path_map[$i];
}
if (isset($tab_root_map[$i]) && $tab_root_map[$i] == '%') {
$tab_root_map[$i] = $path_map[$i];
--- 774,780 ----
}
for ($i = 0; $i < $router_item['number_parts']; $i++) {
if ($link_map[$i] == '%') {
! $link_map[$i] = isset($path_map[$i]) ? $path_map[$i] : "";
}
if (isset($tab_root_map[$i]) && $tab_root_map[$i] == '%') {
$tab_root_map[$i] = $path_map[$i];

The problem comes about when I try to present a menu with nothing "selected"; $router_item['path'] is "products/%/%", but $map is just ["products"]. The error message was: "Notice: Undefined offset: 1 in _menu_translate() (line 777 of /home/codemeta.com/milessmithfarm.com/20131205/includes/menu.inc).", with an additional message for offset: 2.

The application used to work in D7.23, but doesn't in D7.27. (I don't think it works in D7.28, but I may have botched my dev environment trying it out.)

Comments

Drupal ladder

damienmckenna's picture

You should bug the other Manch'rs to have a Drupal Ladder intro at the next meetup, so they could show you how to search the core issue queue and report the problem if there isn't already a bug report for it.

I recently found a Drupal

Bob Newby's picture

I recently found a Drupal core bug and reported it in what I assume is the accepted way. Of course, the Drupal community's black-box practices being what they are is where core is concerned, I really don't know if my report really is the right way to have done so. Read on...

You can see my bug report at https://www.drupal.org/node/2292505. Note that there is a link at the top of the report which is a link to the API page documenting the function containing the bug.

When you look at that API page, you will see instructions at the head of the comments section about filing an issue against the function in question, including a link. That is what I used, and it automatically inserted the URL linking to the API page in question.

My question is: Will D7's core maintainers ever actually look and and follow up on my issue report.

Bruce, good luck!

--

P.S. - "Drupal Ladder"? What the !?!? is that?

I took a look at that issue

damienmckenna's picture

I took a look at that issue and reported back, I suggest trying the most recent patch in #315302 to see if that resolves the problem.

The Drupal Ladder: http://drupalladder.org - bug Jake & Michelle about it :)

As for the issue queue and "black-box practices" - there are no "black box practices", it's all just people reviewing & commenting on issues; issues that people follow-up on and build a reliable patch that others review & mark "RTBC" will stand a good chance of being committed. There is no hired team that goes through and reviews all new issues, so talking to others about it (e.g. on IRC, twitter, email, in person, here, etc) helps your issue's chances of being reviewed by someone. You might take a look at https://www.drupal.org/node/73178 and http://webchick.net/embrace-the-chaos for some insight. One of the issues I linked to in my response to your issue is from my early days working with Drupal 6, back in 2009 – that issue still hasn't been resolved, not because someone decided it wasn't worthy, but because it fell off our collective radars so nobody worked on it in several years; that said, it's on my radar again :)

Code review?

damienmckenna's picture

You might try bringing your custom code to the next meetup and asking to do a code review in the group, it's possible a bug somewhere else in your code is triggering the symptom you're seeing in the menu system, and once the bug is fixed the symptom would go away. When dealing with core you'll find this is often the case - often times bugs that you come across are caused by something else that should up as core misbehaving, but once the original bug is fixed the weirdo symptom goes away.

I'm inclined to believe that

BruceDawson's picture

I'm inclined to believe that there's something in the dark recesses of my code/logic that's causing the problem. And of course, I can't find it. :-( And the menu documentation isn't terribly clear on what should happen with the logic I have - although it should still be working. As I indicated, the logic worked in an earlier release, but not the latest releases.

On the other hand, the "fix" I posted provides some additional "bullet proofing" to the core at the cost of creating a (probably unpredictable) default.

But this is good fodder for a meeting topic.

Great answers! Thanks Damien!

miche's picture

Great answers!
Thanks Damien!


Michelle Lauer
michellelauer.com

Yes, Damien... Thanks for

BruceDawson's picture

Yes, Damien... Thanks for addressing the issue.

Its back!

BruceDawson's picture

Well, at least the proper fix we determined at the Manchester Meetup worked for a week or two :-(

But now the same problem is back - only difference is that I updated to the latest Drupal core... 7.29 - and it fails in the same place.

I'm beginning to think the core's menu logic is starting to develop "bit rot", or at least the armor provided by other logic in the core is starting to deteriorate.

Oddly enough, my original

BruceDawson's picture

Oddly enough, my original proposed fix to the core's menu.inc works again!

--- menu.inc.orig	2014-07-19 13:20:12.151439033 -0400
+++ menu.inc	2014-07-19 13:19:55.451438800 -0400
@@ -774,7 +774,11 @@
   }
   for ($i = 0; $i < $router_item['number_parts']; $i++) {
     if ($link_map[$i] == '%') {
-      $link_map[$i] = $path_map[$i];
+      if (isset($path_map[$i])) {
+        $link_map[$i] = $path_map[$i];
+      } else {
+	$link_map[$i] = "";
+      }
     }
     if (isset($tab_root_map[$i]) && $tab_root_map[$i] == '%') {
       $tab_root_map[$i] = $path_map[$i];

Are you sure the modification

damienmckenna's picture

Are you sure the modification you made to your custom module is still there?

Yup...

BruceDawson's picture

One of the first things I checked - the mods are still in my module.

New Hampshire

Group categories

Regional Audience

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: