From #321295: Errors when other modules incorrectly implement link_alter, I did a search for modules that incorrectly implement link_alter. panels 6.x-2.x is one of the offenders. The docs for hook_link_alter() say that the function should be passed $links, then $node (a reversal from D5). Your implementation currently passes the parameters in reverse:
content_types/node_content.inc 6.x-2.x:
107 : if ($conf['links']) {
108 : $node->links = module_invoke_all('link', 'node', $node, $conf['teaser']);
109 :
110 : foreach (module_implements('link_alter') AS $module) {
111 : $function = $module .'_link_alter';
112 : $function($node, $node->links);
113 : }
114 : }
Should be:
if ($conf['links']) {
$node->links = module_invoke_all('link', 'node', $node, $conf['teaser']);
drupal_alter('link', $node->links, $node);
}
I haven't found if the same is used in 6.x-3.x since files were moved around, but I will file proper patches shortly.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 533770-link-alter-D6-2.patch | 845 bytes | dave reid |
| #1 | 533770-link-alter-D6-3.patch | 942 bytes | dave reid |
Comments
Comment #1
dave reidPatches for 6.x-2.x and 6.x.3.x.
Comment #2
merlinofchaos commentedHm. This patch appears to be for a sample that's pretty out of date. I'm not sure it has any value.
Comment #3
lameei commented+1
Comment #4
dave reidWell if the example is out of date, its going to be either updated (in which case it needs this patch) or removed. This was an actual problem that users are reporting with the 6.x-2.x code if they're still on that version.
Comment #5
merlinofchaos commented6.x-2.x has been unpublished so is irrelevant.
The example probably does need to be updated. I'll put that on Sam's radar.
Comment #6
dave reidYeah, if only we could manually force people to upgrade. :) Thanks Earl I appreciate it!
Comment #7
sdboyer commentedFixed, albeit now in ctools. Thanks!