Download & Extend

hook_link_alter call was incorrect

Project:User Comment
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

In usercomment_comment_render() the construction of the link_alter call was incorrect it was calling the function with the parms in the wrong order.

It was this

      $function = $module .'_link_alter';
      $function($node, $links);

But, it should be

      $function = $module .'_link_alter';
      $function($links, $node);

I'll work on creating a proper patch for this.

Comments

#1

Assigned to:Anonymous» chuckdeal97
Status:active» needs review

Here is the patch. It is designed to be run from the usercomment module directory.

AttachmentSize
usercomment_linkalter.patch 443 bytes

#2

It's actually preferred to use:

<?php
drupal_alter
('link', $links, $node);
?>

instead of:

<?php
   
foreach (module_implements('link_alter') as $module) {
     
$function = $module .'_link_alter';
     
$function($node, $links);
    }
?>

#3

Alright, thanks. When I get a minute, I'll give that a shot. I'm not the original author and I am just trying to get the module working up to snuff.

#4

Ok, how about this then... uses drupal_alter

AttachmentSize
usercomment_linkalter.patch 554 bytes

#5

Priority:normal» critical

Here's the patch for the current DRUPAL-6--1 branch (with the correct offset).

AttachmentSize
usercomment-alter-links-D6.patch 502 bytes

#6

Any progress on this bugfix?

#7

I have applied this fix to my code and it fixes the problem. I was hoping that someone other than me has applied and verified the solution.

I'm not the maintainer, and I don't know what the procedure for creating a new project release is, but there are a number of D6 patches that should be applied to this project, in addition to this one.

#8

Yeah, looks like the maintainer is not active at all. The only code update in 2008 was one update in September.

#9

Status:needs review» fixed

The code should be fixed in the latest dev snapshot.

#10

Assigned to:chuckdeal97» Anonymous

Thanks very much gwen!

#11

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here