I am using Automatic Entity Label to create the Title field using two tokens for first and last name and then using the title field as Full Name. The problem I am running into is that when the last name has an apostrophe, the ' is converted to '

Example of my fields:
field_first_name: John
field_last_name: O'malley

Title (Full Name): John O & # 0 3 9 ; malley

Is there anything I can do to fix this?

Comments

courtvb’s picture

Sorry, the apostrophe was converted & # 0 3 9 ; (no spaces) is what is shown in lieu of the apostrophe.

bforchhammer’s picture

Component: Code » Documentation
Category: bug » support
Status: Active » Fixed

This is actually works as designed... kindof.

For field tokens, the token value is generated by rendering the field with the "token" view mode, i.e. with whichever formatter is set up on Node Type > Manage Display > Tokens. If you don't have the Tokens view mode configured, it will fall back to the Default view mode; which by default santitizes text field values, i.e. replaces things like hypens with '.

So in order to fix your labels: enable the tokens view mode and set the field formatter to Plain text.

Alternatively you could also use the field tokens provided by the entity tokens module, as they are not sanitized by default and show up correctly. I'd recommend the other way though, because the tokens list gets a bit confusing with duplicate field tokens. (To tell them apart: token module field tokens use underscores, like [node:field_name]; and entity token module uses hypens, like [node:field-name]).

courtvb’s picture

Thanks Benedikt! I took your advice and enabled the tokens view mode and set the format to plain text. Really appreciate your help.

Court

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

typo