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
Comment #1
timtrinidad commentedI had this problem too. Here's what I ended up using (note the " instead of the '):
return "[field_song_title-raw]";Comment #2
fagoThat'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.
Comment #3
radman16 commentedSo 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.