Following details, please note I changed
my $table = $DB->table('Users'); to
my $table = $DB->table('Links');
Quote:
A fatal error has occured:
Bizarre copy of HASH in sassign at /admin/GT/Config.pm line 619.
Please enable debugging in setup for more details.
Stack Trace
======================================
Links (25122): Links::environment called at /admin/Links.pm line 712 with no arguments.
Links (25122): Links::fatal called at /admin/GT/Config.pm line 619 with arguments
(Bizarre copy of HASH in sassign at /admin/GT/Config.pm line 619.
).
Links (25122): Links::Utils::format_title called at GT::Template::_call_func line 766 with arguments
(ARRAY(0x86f94d0), separator, > , no_escape_separator, [undef], include_home, 1, link_type, 2).
Links (25122): GT::Template::_call_func called at /admin/templates/luna/compiled/add.html.compiled line 550 with arguments
(GT::Template=HASH(0x87032ec), Links::Utils::format_title, 1, ARRAY(0x86f94d0), separator, > , no_escape_separator, [undef], include_home, 1, link_type, 2).
Links (25122): GT::Template::parsed_template called at /admin/GT/Template.pm line 552 with arguments
(GT::Template=HASH(0x87032ec)).
Links (25122): GT::Template::_parse called at /admin/GT/Template.pm line 145 with arguments
(GT::Template=HASH(0x87032ec), add.html, HASH(0x86fc1a8)).
Links (25122): GT::Template::parse called at /admin/Links.pm line 445 with arguments
(GT::Template, add.html, ARRAY(0x86f4ed8), HASH(0x86fc1a8)).
Links (25122): Links::user_page called at /admin/Links/SiteHTML.pm line 307 with arguments
(add.html, HASH(0x86fe888), HASH(0x86fc1a8)).
Links (25122): Links::SiteHTML::__ANON__ called at /admin/GT/Plugins.pm line 133 with arguments
(HASH(0x86fe888), [undef]).
Links (25122): GT::Plugins::dispatch called at /admin/Links/SiteHTML.pm line 27 with arguments
(GT::Plugins=HASH(0x83421d4), site_html_add, CODE(0x86fc238), HASH(0x86fe888), [undef]).
Links (25122): Links::SiteHTML::display called at /admin/Links/User/Add.pm line 171 with arguments
(add, HASH(0x86fe888)).
Links (25122): Links::User::Add::handle called at /admin/GT/Plugins.pm line 133 with no arguments.
Links (25122): GT::Plugins::dispatch called at add.cgi line 26 with arguments
(GT::Plugins=HASH(0x83421d4), handle_add, CODE(0x8187ba4)).
Code:
sub {
my $column = $_[0];
my $selected = $_[1];
my $table = $DB->table('Links');
my %hash;
my $i = 0;
my $names = $table->form_names->{$column};
my $vals = sort $table->form_values->{$column};
for my $val (@$vals) {
$hash{$val} = $names->[$i++];
}
my $html = $DB->html($table, $IN);
my $form = $html->select({
name => "$column",
values => \%hash,
value => $selected });
$form =~ s|\Q<option value="">---</option>|<option value="">-what you want here</option>|;
if (!$IN->param($column)) {
my @entries = split /\</option\>/, $form =;
$entries[1] =~ s|<option value=\"(.*?)\">(.*?)</option>|<option value="$1" selected="yes">$2</option>|;
$form = join("</option>\n",@entries);
}
return $form;
}
Regards
minesite