Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Accessing modify_link as a POST hook?

Quote Reply
Accessing modify_link as a POST hook?
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:

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 Smile

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

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!

Last edited by:

Andy: Aug 24, 2012, 9:12 AM
Subject Author Views Date
Thread Accessing modify_link as a POST hook? Andy 4850 Aug 24, 2012, 8:09 AM
Thread Re: [Andy] Accessing modify_link as a POST hook?
Andy 4712 Aug 24, 2012, 8:11 AM
Thread Re: [Andy] Accessing modify_link as a POST hook?
brewt 4675 Aug 24, 2012, 11:22 AM
Post Re: [brewt] Accessing modify_link as a POST hook?
Andy 4664 Aug 27, 2012, 1:31 AM
Thread Re: [Andy] Accessing modify_link as a POST hook?
brewt 4697 Aug 24, 2012, 11:21 AM
Post Re: [brewt] Accessing modify_link as a POST hook?
Andy 4676 Aug 27, 2012, 1:29 AM