case 1:

The following text:

This is a link to the [node:61] node
This is a link to the [node:61,title="foo"] with an alternate title
This is a link to the [node:61,title="bar"] with an alternate title

Produces the following output:

This is a link to the Service and Outreach node
This is a link to the Service and Outreach with an alternate title
This is a link to the Service and Outreach with an alternate title

case 2:

The following text:

This is a link to the [node:61,title="foo"] with an alternate title
This is a link to the [node:61,title="bar"] with an alternate title
This is a link to the [node:61] node

Produces the following output:

This is a link to the foo with an alternate title
This is a link to the bar with an alternate title
This is a link to the bar node

Comments

reikel’s picture

Case 1 is caused by a bug at line 99 of link_node.module, where $meta_tag_params_regexp is changed to $meta_tag_params_regexp2 inside the foreach( match[1] ) loop. Thus, after $meta_tag_params_regexp fails to match once, it is never tried again.

Here are the diffs to fix the bug:

99c99
<             $meta_tag_params_regexp=$meta_tag_params_regexp2 ;
---
>             (preg_match_all($meta_tag_params_regexp2, $match[2][$key], $parm_match)) ;
101c101
<           if (preg_match_all($meta_tag_params_regexp, $match[2][$key], $parm_match)) {
---
>           if( count( $parm_match )) {

Still looking at Case 2. I'm guessing it's caused by some internal drupal node caching, so that node_load() at line 87 does not actually get a fresh copy of the node each time.

reikel’s picture

Case 2 is indeed caused by internal node caching, which apparently is new in Drupal 7, at least according to this guy: http://www.computerminds.co.uk/articles/drupal-7-nodeload-references

Per the suggestion in his comment thread, here are the diffs to fix the bug:

87c87
<         $node = node_load($nid);
---
>         $node = node_load($nid, NULL, TRUE);

  • ecf1914 committed on 7.x-1.x
    Issue #1390774: Inconsistent behavior when linking to same node...
TomChiverton’s picture

Issue summary: View changes

Will be in next release

TomChiverton’s picture

Status: Active » Closed (fixed)