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

Re: [twssser] Problems with modify_link hook

Quote Reply
Re: [twssser] Problems with modify_link hook In reply to
There is another issue going on here, as well. If you are modifying fields that are stored in the modifications database, then you'd want to edit *that* hash directly. Retrieve it, modify it, then save it back.

Look in User::Modify.pm for the dumper code, to see how that works.

If what you are trying to do can be done pre_ code wise, you might want to edit your Modify.pm file to "use mymodule.pm", then make a call to run the code in your module. This is not portable, and you'd have to do it for each new install of links, but you can do that. It's two lines of code, and you can put both the "use" and call to the module in the subroutine (its' not good form, but it works, and keeps it together). Then, if you modify the external pm file, you are not actually editing the Modify.pm any longer, but your own module. You could also use "require", rather than "use", to add the code to the file. That would be one line of code in Modify.pm, or more safely:

eval{require "mycode.pl"};
#if($@) {
# print "Failed to load mycode.pl\n";
#}

The plugin system was to make sure large changes in behaviour did not have to be carried through each new generation. But, small, site specific changes to the code are almost inevitable. Sometimes a plugin is like using a sledge hammer to put a tack into a cork board.

Just keep a little file of "code edits" in the main links directory, and refer to it any time you update links.

Hopefully, alex will look at that pre- code thing, and see what the problem is :)


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Subject Author Views Date
Thread Problems with modify_link hook twssser 2785 Sep 23, 2002, 3:20 PM
Thread Re: [twssser] Problems with modify_link hook
pugdog 2682 Sep 24, 2002, 2:49 AM
Thread Re: [pugdog] Problems with modify_link hook
twssser 2691 Sep 24, 2002, 3:53 AM
Thread Re: [twssser] Problems with modify_link hook
pugdog 2674 Sep 24, 2002, 5:56 AM
Thread Re: [pugdog] Problems with modify_link hook
twssser 2678 Sep 24, 2002, 3:43 PM
Thread Re: [twssser] Problems with modify_link hook
pugdog 2661 Sep 25, 2002, 9:15 AM
Post Re: [pugdog] Problems with modify_link hook
twssser 2638 Sep 25, 2002, 1:57 PM