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);
}
Comment | File | Size | Author |
---|---|---|---|
#2 | node_clone-1599354.patch | 625 bytes | Nneka |
#1 | node_clone-1599354.patch | 0 bytes | Nneka |
apostrophe.png | 26.61 KB | Nneka |
Comments
Comment #1
NnekaComment #2
NnekaThe first patch file is empty. This one has the patch.
Comment #3
pwolanin CreditAttribution: pwolanin commentedAh, good catch - bit by my own core API change.
Comment #4
pwolanin CreditAttribution: pwolanin commentedcommitted & credited to you.
Comment #5.0
(not verified) CreditAttribution: commentedcorrection
Comment #7
angelsmit CreditAttribution: angelsmit as a volunteer and commentedTo 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.