In Drupal 6.3, I have created a custom type called Restaurant and another called Review that has a nodereference to a Restaurant node. Based on http://drupal.org/node/65133, I expected that the $referencing_node variable available to the nodereference field would be populated with the node object of the parent Review node. That way, I could determine the context of the child Restaurant node being referenced and theme it as desired. However, examining what variables are available shows that $referencing_node (and $referencing_field) is empty. What is going on here?

Comments

dunx’s picture

Yes, I was happily using that variable to theme some teasers for nodereferences differently on certain pages. There nodereference.module has a function (theme_nodereference_formatter_full_teaser) that sets the variable, but it doesn't seem to get called for all nodereference teasers.

Not sure when it changed for me and there's been lots of water under the bridge since I was using this method and only just noticed it's gone.