Closed (outdated)
Project:
Link
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Dec 2011 at 22:25 UTC
Updated:
31 Aug 2024 at 11:10 UTC
Jump to comment: Most recent
Steps to reproduce:
$nid = // Some nid of a node that has a link with the title 'Foo & Bar' linked to 'http://example.com/'.
$node = node_load($nid);
debug($node->field_link);
node_view($node, 'full');
debug($node->field_link);
The first debug after node_load() will look like:
array (
'und' =>
array (
0 =>
array (
'url' => 'http://example.com/',
'title' => 'Foo & Bar',
'attributes' =>
array (
),
),
),
)
The second debug() after the call to node_view() results in:
array (
'und' =>
array (
0 =>
array (
'url' => ''http://example.com/',
'title' => 'Foo & Bar',
'attributes' =>
array (
),
'display_url' => 'http://example.com/',
'html' => true,
),
),
)
Notice the 'title' attribute has been escaped. Now if I'm trying to use this raw link data to output elsewhere, I'm screwed. The link module should *not* be altering field data on the node. If we were to call node_save() after this code, it would result in data loss as Foo & Bar would be saved as the 'title' value in the field.
Comments
Comment #1
dqd100% Agreed. Sadly this one hasn't popped up in my issue dashboard back in the days. Does anyone knows if it still persist?
Apart from that: I'll close this issue ether way due to inactivity for 12 years and upcoming EOL of Drupal 7 in January 2025. While the project version for Drupal 7 will keep providing support for security issues and website breaking bug fixes for Drupal 7, we should try to minimize the open issues for Drupal 7 in the queue as much as possible. Thanks for the report and all the efforts in here. Feel free to re-open if you can provide a fix or found an additional related problem which increases the issue priority to "Critical" here.