After saving or updating a node node_form_submit() calls drupal_set_message(t('@type %title has been updated.', $t_args));. If building the node->title from cck fields with the formatted values that contain an apostrophe, the html encoding 'a is displayed in the message returned to the user.

Comments

dsbrianwebster’s picture

I was having this same problem when trying to grab the Location Name from the location module as the page title. Whenever there was an apostrophe I would get ' -- ugly.

It seems the problem is Autonode titles with Tokens. Use a PHP replacement pattern instead. For my situation (working with the location name field) the below code worked like a charm.

echo $node->locations[0]['name'];

Be sure "Evaluate PHP in pattern." check box is checked.

tim.plunkett’s picture

<?php
echo $node->field_location[0]['name'];
?>

worked for me.

i'd much rather use tokens, but this is a little above my expertise to troubleshoot.

El Bandito’s picture

Hit this one too.

Subscribing.

cerup’s picture

Same here!

subscribing.

Pierre_G’s picture

subscribing

Hardrocker’s picture

Where do u put the replacement patterns. I'm stuck with the same problem too.

fago’s picture

Status: Active » Closed (works as designed)

The description tells you to use raw values if possible.

scotwith1t’s picture

Title: Apostrophe In Formatted Auto Node Title » Apostrophe in location name - provide raw token for auto nodetitles
Project: Automatic Nodetitles » Location
Version: 6.x-1.2 » 6.x-3.1
Category: bug » task
Status: Closed (works as designed) » Active

Reassigned to Location as this module doesn't provide -raw tokens for any fields. There may be good reason for this, maybe related to GMap interaction or something, but anyway, it's not an ANT issue. I couldn't get the php options to work for me either...

drupalina’s picture

On my site Node titles are their addresses: "Street, City". In Drupal 6 for AutoNoteTitles I used the following PHP

<?php
return $node->field_location[0]['street'] . ', ' . $node->field_location[0]['city'];
?>

In D6 it works like a charm!

Now I'm trying to move to D7 and I have no clue about the need code that I need.

Can anybody help, please?

legolasbo’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing old D6 issues as D6 is end of life