Download & Extend

Special characters break creation of automatically generated node titles

Project:Automatic Nodetitles
Version:6.x-1.2
Component:Code
Category:bug report
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

If a token used by the 'Automatic Nodetitles' module contains special characters like an apostrophe (', HTML: '/' or ’/’), the automatic generation of the node titles breaks. Error message from watchdog log:

article: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/drupal/sites/all/modules/auto_nodetitle/auto_nodetitle.module(220) : eval()'d code on line 7 has been added.

The created node title will look like this:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/drupal/sites/all/modules/auto_nodetitle/auto_nodetitle.module(220) : eval()'d code on line 7

Ugly, isn't it? Obviously a title like this will break all kinds of other things, e.g. sorting by node title. Since characters like the apostrophe are not too uncommon, it's quite impossible to avoid them to show up in tokens (like "Drupal's greatest accomplishments" ;). So the only workaround for this is to make the node title editable for manual correction (which tends to break other site logic, e.g. consistency of user generated content).

So please fix this, if possible ;)

Thanks & greetings, -asb

Comments

#1

This looks like the same issue as, or at least closely related to, #1071596: HTML Special characters in node title and #1071596: HTML Special characters in node title.

#2

I think this will only happen when using -raw tokens. Other tokens will be escaped properly (hence the problems in #1071596: HTML Special characters in node title and #878570: Do not sanitize title in function _auto_nodetitle_patternprocessor).

nobody click here