Posted by Dave Reid on July 28, 2009 at 9:01pm
5 followers
| Project: | Panels |
| Version: | 6.x-3.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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:
<?php
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.
Comments
#1
Patches for 6.x-2.x and 6.x.3.x.
#2
Hm. This patch appears to be for a sample that's pretty out of date. I'm not sure it has any value.
#3
+1
#4
Well 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.
#5
6.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.
#6
Yeah, if only we could manually force people to upgrade. :) Thanks Earl I appreciate it!
#7
Fixed, albeit now in ctools. Thanks!
#8
Automatically closed -- issue fixed for 2 weeks with no activity.