Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [afinlr] form_link self->code bug

Quote Reply
Re: [afinlr] form_link self->code bug In reply to
I put it inside my plugin:
I plug into display_link and form_link.

look in Links::HTML::Links::_plg_display and _plg_form.

You'll see the GT code and how they call \&form_expiry; or \&disp_expiry;
the problem is that we lose those self->{code}->{ExpiryDate} when plugging in.
So in order to re-establish them and NOT have to copy the code, we need to create the self->{code}->{ExpiryDate} code with an explicit call to that subroutine as I mentioned above.

If you're pluggin into display_link, you'll need to do the same with LinkOwner.


hope that helps.

sub form_link {
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'form_link'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($self, $opts) = @_;
$self->{code}->{myfield} = \&form_myfield;
$self->{code}->{ExpiryDate} = \&Links::HTML::Links::form_expiry;

}
Subject Author Views Date
Thread form_link self->code problem klangan 8202 Jun 9, 2005, 1:42 PM
Thread Re: [klangan] form_link self->code problem
afinlr 8088 Jul 19, 2005, 3:00 PM
Thread Re: [afinlr] form_link self->code bug
klangan 8103 Jul 19, 2005, 3:17 PM
Post Re: [klangan] form_link self->code bug
afinlr 8072 Jul 19, 2005, 3:20 PM
Thread Re: [klangan] form_link self->code bug
afinlr 7955 Mar 22, 2007, 11:39 AM
Thread Re: [afinlr] form_link self->code bug
klangan 7949 Mar 22, 2007, 1:41 PM
Thread Re: [klangan] form_link self->code bug
afinlr 7953 Mar 22, 2007, 2:24 PM
Thread Re: [afinlr] form_link self->code bug
klangan 7948 Mar 22, 2007, 2:50 PM
Post Re: [klangan] form_link self->code bug
afinlr 7956 Mar 22, 2007, 3:01 PM
Thread Re: [afinlr] form_link self->code bug
brewt 7947 Mar 22, 2007, 3:27 PM
Thread Re: [brewt] form_link self->code bug
afinlr 7930 Mar 22, 2007, 4:36 PM
Thread Re: [afinlr] form_link self->code bug
brewt 7932 Mar 22, 2007, 4:41 PM
Post Re: [brewt] form_link self->code bug
afinlr 7924 Mar 22, 2007, 5:18 PM
Thread Re: [brewt] form_link self->code bug
afinlr 7919 Mar 24, 2007, 12:42 PM
Thread Re: [afinlr] form_link self->code bug
afinlr 7919 Mar 24, 2007, 6:20 PM
Thread Re: [afinlr] form_link self->code bug
afinlr 7911 Mar 24, 2007, 8:27 PM
Post Re: [afinlr] form_link self->code bug
afinlr 7919 Mar 25, 2007, 11:18 AM