Gossamer Forum
Home : Products : Gossamer Links : Discussions :

User options outside of Install.pm?

Quote Reply
User options outside of Install.pm?
Hi...I've tried using Alex's suggestion in one of his threads, to install new options in the main plugin. I have;

Code:
Links::Plugins::set_plugin_user_cfg ('Cron_Manager', [ ['Email_SQL_Backup_Notification',
$notification, 'Email you after a SQL Database backup has been made? (1=yes, 0=no)...', 'TEXT',
[], [], '' ] ]);

The suggestion he gave was;

Code:
Links::Plugins::set_plugin_user_cfg ('Cron_Manager', $cfg );

I get an error though, saying;

A fatal error has occured:

Quote:
Can't coerce array into hash at /home/virtual/site6/fst/var/www/cgi-bin/admin/Links/Plugins.pm line 53.

Please enable debugging in setup for more details.

Anyone got any ideas? Probably another stupid question....but I'm still a bit tired after being at an all night party last night Wink

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] User options outside of Install.pm? In reply to
Did you solve this one?

That command is essentially how the plugins are updated after a modify in the admin, being able to set/modify/alter/delete is pretty basic, I would assume.

Did you enable debugging and check what line 53 was?

original config post was http://www.gossamer-threads.com/...orum.cgi?post=120582


PUGDOG� Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] User options outside of Install.pm? In reply to
Nah, I never got this figured out. The code on line 53 in Plugins.pm is;

Code:
foreach my $opt (@{$cfg->{$plugin_name}->{user}}) {
$opt->[1] = $hash->{$opt->[0]};
}

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] User options outside of Install.pm? In reply to
I would have thought it is fairly obvious looking at the set_plugin_user_cfg subroutine.

The third line is:

my $hash = shift || return;

...and clearly you are trying to pass in an array reference - hence can't coerce an array (you passed in) into a hash (what it wants).

Did you even read the description of the subroutine on about line 50?

>>
# Takes a plugin name and config hash and saves it.
<<

Last edited by:

Paul: Dec 31, 2002, 2:29 AM