subj

Comments

dynamind’s picture

This issue lacks a description, but I figure it concerns the same issue I was having:

It is impossible to use Block Visibility rules on nodes mapped by node_breadcrumb. This is true for the include/exclude paths and the PHP condition.

The reason is that the module changes the value of $_GET["q"]. In effect it fools Drupal's menu system in thinking it's actually showing a different page.

So when you try to determine the current node, it returns the node of the page it is attached to - not the node itself.

I could not wait for a general fix, so I hacked one myself.

Open the file node_breadcrumb.module and do the following change

function _node_breadcrumb_set_location(...) {
  $path = $_GET["q"]; // <-- add this line to store current path
  /* Normal code goes here untouched */
  $_GET["q"] = $path; // <-- add this line to restore current path
}

I hope someone finds this useful!

edhel’s picture

dynamind, this code fix block visibility rules, but we lost menu location of nodes

edhel’s picture

Status: Active » Fixed

fixed in beta3

Status: Fixed » Closed (fixed)

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

brad.bulger’s picture

it is still overwriting $_GET['q'] to be the last breadcrumb path. is that a by-design thing? it's turning up as a problem all over my theme code, which does things based on the current path. scratch that - i didn't realize that dev was older than the beta releases.