I create my node title from two custom cck textfields: firstname and
lastname.

When lastname contains a string with an embedded quote (e.g "D'Ascanio")
I get this error:

Parse error: syntax error, unexpected T_STRING in /usr/local/share/drupal/modules/auto_nodetitle/auto_nodetitle.module(220) : eval()'d code on line 4

Comments

timtrinidad’s picture

I had this problem too. Here's what I ended up using (note the " instead of the '):
return "[field_song_title-raw]";

fago’s picture

Status: Active » Closed (works as designed)

That's a dangerous snippet, from the latest (dev) readme:

You can combine php evalution with the token module, because tokens are replaced first.
However be aware to don't use this with any textual values provided by users as this would
open a security hole. If you are in doubt, don't combine tokens with php evaluation.

radman16’s picture

So what is the recommended way of avoiding this error when the token field contains punctuation. I have seen this or similar error when the field contains either a quote or a period.