I'm trying to update a field with the format full_html. But when I'm updating the field, all the html tags will disappear and the old text is still there in the safe_value. So how can I update the the text in field and keep the existing structure and the html-tags?
I have tried this:
$node = $node_load($my_node_id);
$node->body['und'][0]['value'] = 'My new text.';
My field before editing
[body] => Array
(
[und] => Array
(
[0] => Array
(
[value] => <p>My old text.</p>
[summary] =>
[format] => full_html
[safe_value] => <p>My old text.</p>
[safe_summary] =>
)
)
)
My field after editing
[body] => Array
(
[und] => Array
(
[0] => Array
(
[value] => My new text. //All the html-tags are removed
[summary] =>
[format] => full_html
[safe_value] => <p>My old text.</p> //The old text is still there
[safe_summary] =>
)
)
)
$node = $node_load($my_node_id);
as I doubt you've defined$node_load = 'node_load';
anywhere – Clive♦ Jan 9 at 9:53