I've been trying to debug an issue with a custom module and figured out that the problem occurred in our upgrade from Drupal 5.2 to Drupal 5.3. We have a custom module that we want to display content on a specific page so we set it up to trigger when the target path came up:

function custom_nodeapi(&$node, $op) {

       if( ($op == 'view') and ($node->path == 'targetpath') ) {  

However, after Drupal 5.3 this stopped working for anonymous users so I had to come up with another way ($node->title == "targettitle") to trigger this page for all users.

I browsed CVS but not sure why this behavior changed -- is there a better way we should write this?

Thanks,

- schnippy

Comments

oeln’s picture

Identical problem in version 5.5: I need a way to obtain the value of $node->path in page.tpl.php, which only works now if I'm logged in while viewing pages.

Edit: I've gotten the following to work instead:

drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);
drupal_init_path();
$path = drupal_lookup_path('alias', $_GET['q']);
Tom Jacobs’s picture

seek to my fixed report http://drupal.org/node/204413