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

Need some advice on enhancing Plugins

Quote Reply
Need some advice on enhancing Plugins
Hi there,

We have plugin called "Guestbook", which some company created a while back. Now, a couple of years later, we needed to add extra functionality to that plugin. In this specific scenario, we are getting the Guestbook entries for a specific user. It used to be only for a link. Being the haphazard coder I am, I modified the plugin's .pm file.

Now, the additional function is working, but with every 3-5 refreshes of the page/template the function is called, it complains that GT can't find that function inside the module :

Code:

Error: Unable to load module 'Plugins::Guestbook':
Error: No subroutine 'Plugins::Guestbook::load_guestbook_user' in 'Plugins/Guestbook.pm'


Seeing as I obviously did something wrong, could someone please explain to me the proper way of doing it? For now I moved the function to a global, but it is simply just to much code to stay there.

Regards,
Pieter


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Need some advice on enhancing Plugins In reply to
If you have mod_perl, maybe try rebotiing it? Mod_perl loads those kinda bits into memory, so every few attempts you may well have just been accessing an older version of the file (where the function didn't exist)

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!
Quote Reply
Re: [Andy] Need some advice on enhancing Plugins In reply to
Is it safe to do it? To reboot mod_perl, I mean. The function has been doing this for the last 9 months. It became really irritating, so now I'm trying to find another way of doing it...


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Need some advice on enhancing Plugins In reply to
Well, whenever I make a change in a .pm file, and I want to test it - I always reboot mod_perl. Its not hard to do:

service mod_perl configtest

(to make sure it will reboot ok)

...then

service mod_perl restart

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!
Quote Reply
Re: [Andy] Need some advice on enhancing Plugins In reply to
I wouldn't by any chance need root access to restart mod_perl... would I?


Sacrifice is not about what you lose,
it is about what you gain in the process.
Quote Reply
Re: [EZFrag] Need some advice on enhancing Plugins In reply to
Hi,

Yeah, normally you would (although there is normally a way to do it on a per-site basis too)

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!