Incorrect implementation of link_alter
Dave Reid - December 6, 2008 - 01:53
| Project: | Forum Thread |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | jbrauer |
| Status: | closed |
Description
From #321295: Errors when other modules incorrectly implement link_alter I did a search for modules that incorrectly implement link_alter. forumthread 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:
<?php
$links = module_invoke_all('link', 'comment', $comment, 1);
foreach (module_implements('link_alter') as $module) {
$function = $module .'_link_alter';
$function($node, $links);
}
?>Should be
<?php
$links = module_invoke_all('link', 'comment', $comment, 1);
drupal_alter('link', $links, $node);
?>
#1
Patch included for your review.
#2
Thanks Dave. I'll get that addressed!
#3
Thanks very much JBrauer!
#4
Any progress on this?
#5
Thanks Dave looks good... it's in -dev
#6
Committed long ago now.