Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1418444-4.patch | 1.71 KB | manish-31 |
auto_nodetitle-escape-before-eval.patch | 1.44 KB | David Lesieur |
Comments
Comment #1
rsgracey CreditAttribution: rsgracey commentedThe 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.
Comment #2
David Lesieur CreditAttribution: David Lesieur commentedCould you detail more precisely what has not worked with the patch? Thanks.
Comment #3
manish-31 CreditAttribution: manish-31 at OpenSense Labs for DrupalFit commentedThis 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.
Comment #4
manish-31 CreditAttribution: manish-31 at OpenSense Labs for DrupalFit commentedThis patch will solve this issue. Needs Review.
Comment #6
gaurav.kapoor CreditAttribution: gaurav.kapoor commented