Automatic Nodetitles fails with the Evaluate PHP in pattern option if a token's replacement contains quotes — the eval function returns: "Parse error: syntax error, unexpected T_STRING".

Characters that risk being interpreted by PHP in the token replacements must be escaped before the code is evaluated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rsgracey’s picture

The patch hasn't worked for us. We have wrapped the token statements with a preg-replace command:

$eng_org=preg_replace('/\'/','-','[node:field_eng_org]');

It encoded the apostrophes for Unicode, but at least it's evaluating.

David Lesieur’s picture

Could you detail more precisely what has not worked with the patch? Thanks.

manish-31’s picture

Issue summary: View changes

This issue doesn't occur now. I have used a token that returns quotes and backslashes it generates title correctly. Please close or fix this is not an issue now.

manish-31’s picture

Assigned: Unassigned » manish-31
FileSize
1.71 KB

This patch will solve this issue. Needs Review.

gaurav.kapoor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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