As soon as I enable the menu_breadcrumb module, project.module breaks - I can create new project nodes fine, but when I try to edit an existing one, all the fields that come from project.module are blank.

This seems to be similar in nature to the issue being discussed at #376377: Issue + organic group incompatibility in that project_project_load fails to load, and so $node->project is empty making editing project nodes impossible.


mrfelton’s picture

Project: Project » Menu Breadcrumb
Component: Projects » Code

A little update on this: the problem is that menu_breadcrumb calls menu_get_item() in hook_init(). This is the same issue that was reported in some detail against the globalredirect module here #342131: Use of hook_init() causes problems for modules with autoloading URL arguments. Since this is a problem of menu_breadcrumb, I'm moving this issue over to the menu_breadcrumb issue queue.

subcomandante’s picture

I have the same problem forcing me to disable menu_breadcrumb module on all my sites which uses project module. Hope this will be simple to fix because I found this module very useful.

dazweeja’s picture

This module causes the same problem with OG Forum and I assume any other module that uses _load functions to autoload URL arguments. Can menu_get_item() be moved outside of hook_init() so that it doesn't break other modules? As mentioned in the issues linked above, this is why menu_get_item() is not used in any core modules until after all bootstrap functions have had a chance to complete.

joemaine’s picture

Yes, issue with OG Forum

ru.meta’s picture

+1 with OG Forum

dazweeja’s picture

This patch solves the problem for OG Forum.

Patrizio’s picture

Maybe it solves the OG problem, but i still have the project module incompatibility


Patrizio’s picture

Status: Active » Needs review

menu_get_item() is not the problem, but it is useless.
Removing the function drupal_get_breadcrumb(), the breadcrumb still compare and the problem does not occur

--- menu_breadcrumb.module      (revision 32)
+++ menu_breadcrumb.module      (working copy)
@@ -302,8 +302,9 @@
 function menu_breadcrumb_init() {
   if (variable_get('menu_breadcrumb_determine_menu', 1)) {
     // Find the set of menus containing a link for the current page.
-    $menu_item = menu_get_item();
-    $result = db_query("SELECT mlid, menu_name FROM {menu_links} WHERE link_path = '%s'", $menu_item['href']);
+    # PB:2011/01/10 tolgo menu_get_item abbastanza inutile
+    $menu_item = drupal_get_normal_path(substr(request_uri(), 1));
+    $result = db_query("SELECT mlid, menu_name FROM {menu_links} WHERE link_path = '%s'", $menu_item);
     $menu_link_menus = array();
     while ($menu_link = db_fetch_array($result)) {
       $menu_link_menus[$menu_link['menu_name']] = TRUE;
@@ -335,7 +336,8 @@

   // Generate the breadcrumbs using the active menu.
-  $breadcrumb = drupal_get_breadcrumb();
+  # PB:2011/01/10 tolgo sta roba visto che il modulo funziona ugualmente e evito un incompatibilita con project
+  //$breadcrumb = drupal_get_breadcrumb();

   if (variable_get('menu_breadcrumb_append_node_title', 0) == 1) {
     if (variable_get('menu_breadcrumb_append_node_url', 0) == 1) {