Hi,
This issue has been a thorn in my side for a while now. It seems that when doing a modify_link PRE hook, we get ALL the link info passed into the function with @_ ... but when doing it using a POST hook, all that gets passed along is 1 ... why is this? I've checked that there are no other plugins accessing modify_link (in case they were not passing back @args properly), and and thats not the case. The only way I seem to be able to do what I'm trying - is to edit /Table/Links.pm:
return $ret;
Then in my plugin POST hook, I can use:
# I have to custom pass a value with the LinkID in it - otherwise we can't get it in POST modify_link hook!
print "BLA: $CUSTOM::LID ";
return @_;
}
Surely the PRE hook is done BEFORE we actually do the update... so in cases like mine (where I want to run stuff AFTER its been updated), this doesn't work? My "hack" will work for the mean time, but when I come to update a couple of my plugins it would be to have this fixed up
Oh, and FWIW add_link DOES return the link_id into $_[0] in the POST hook - that all I'm after
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
This issue has been a thorn in my side for a while now. It seems that when doing a modify_link PRE hook, we get ALL the link info passed into the function with @_ ... but when doing it using a POST hook, all that gets passed along is 1 ... why is this? I've checked that there are no other plugins accessing modify_link (in case they were not passing back @args properly), and and thats not the case. The only way I seem to be able to do what I'm trying - is to edit /Table/Links.pm:
Code:
$CUSTOM::LID = $id; # HACK return $ret;
Then in my plugin POST hook, I can use:
Code:
sub admin_modify_link { # I have to custom pass a value with the LinkID in it - otherwise we can't get it in POST modify_link hook!
print "BLA: $CUSTOM::LID ";
return @_;
}
Surely the PRE hook is done BEFORE we actually do the update... so in cases like mine (where I want to run stuff AFTER its been updated), this doesn't work? My "hack" will work for the mean time, but when I come to update a couple of my plugins it would be to have this fixed up

Oh, and FWIW add_link DOES return the link_id into $_[0] in the POST hook - that all I'm after

Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!