No access to $node in PHP pattern

mooffie - February 20, 2008 - 16:33
Project:Automatic Nodetitles
Version:5.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

'$node' isn't recognized when used in the PHP pattern. This happens because drupal_eval() is used and $node isn't in its scope. I'm attaching a patch that fixes this --by evaluating directly. That's, btw, the tactic used by Views (in its 'Argument Handling Code').

I've searched this queue and, surprisingly, the 'official' guidance is to use '$form_values' instead of the non-existing '$node'. I explained here why '$form_values' won't work when using non-trivial CCK widgets.

It's true that tokens can be used. Nevertheless, it would be nice to have access to $node as well.

AttachmentSize
ant_nodephp.diff555 bytes

#1

fago - June 8, 2008 - 14:19
Status:patch (code needs review)» fixed

thanks, I've improved a bit and added some notes and docs. please test it.

I've added this to 5.x-dev and to the 6.x beta release.

#2

Anonymous (not verified) - June 22, 2008 - 14:22
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.