Created a piece of content and want to clone it. When I select 'Clone content', and the title of the node page is 'Clone of This is the test for apostrophe's - lets see.', the Title that displays at the top of the page contains apostrophe's

I've attached an image (apostrophe.png) to see the actual Title that is displayed.

This is a minor issue as the title is being saved correctly and only the displayed title contains apostrophe's. Looked into the code and found the possible reason for this problem..

function clone_node_prepopulate($original_node) {

"
"
 $node->title = t('Clone of !title', array('!title' => $node->title));
      // Add an extra property as a flag.
      $node->clone_from_original_nid = $original_node->nid;
      drupal_set_title(check_plain($node->title));

}

The code is using drupal_set_title and also using check_plain. check_plain is not needed as drupal_set_title also uses check_plain. I've tested the following code and it works correctly..

function clone_node_prepopulate($original_node) {

"
"
 $node->title = t('Clone of !title', array('!title' => $node->title));
      // Add an extra property as a flag.
      $node->clone_from_original_nid = $original_node->nid;
      drupal_set_title($node->title);

}
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Nneka’s picture

FileSize
0 bytes
Nneka’s picture

FileSize
625 bytes

The first patch file is empty. This one has the patch.

pwolanin’s picture

Version: 7.x-1.0-beta1 » 7.x-1.x-dev
Status: Active » Needs review

Ah, good catch - bit by my own core API change.

pwolanin’s picture

Status: Needs review » Fixed

committed & credited to you.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

correction

  • Commit cbfedc8 on 7.x-1.x, 8.x-1.x authored by Nneka, committed by pwolanin:
    Issue #1599354 by Nneka fix for Apostrophe's that display in Title show...
angelsmit’s picture

To solve this, when entering your text use the Alt + 0180. (Hold the alt key down while typing 0180, then release) It produces the closest appearance to apostrophe.