Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Upgrading problem

Quote Reply
Upgrading problem
Hello



After upgrading from 2.05 --> 2.1



I am getting the following error on all my pre made globals (just a sample)



A fatal error has occured:
GT::Config (26290): Unable to compile 'search_top5' in file '/home/virtual/site315/fst/var/www/cgi-bin/links/admin/templates/default/globals.txt': Global symbol "$search_db" requires explicit package name at (eval 18) line 4.Global symbol "$search_db" requires explicit package name at (eval 18) line 5.Global symbol "$sth" requires explicit package name at (eval 18) line 6.Global symbol "$search_db" requires explicit package name at (eval 18) line 6.Global symbol "$sth" requires explicit package name at (eval 18) line 7.Global symbol "$Search" requires explicit package name at (eval 18) line 10.Global symbol "$results" requires explicit package name at (eval 18) line 11.Global symbol "$Search" requires explicit package name at (eval 18) line 12.Global symbol "$in" requires explicit package name at (eval 18) line 13.Global symbol "%LINKS" requires explicit package name at (eval 18) line 14.Missing right curly or square bracket at (eval 18) line 24, at end of line(eval 18) has too many errors. at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Template.pm line 71.


Please enable debugging in setup for more details.Stack Trace======================================Links (26290): Links::environment called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links.pm line 418 with no arguments.Links (26290): Links::fatal called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Config.pm line 437 with arguments (GT::Config (26290): Unable to compile 'search_top5' in file '/home/virtual/site315/fst/var/www/cgi-bin/links/admin/templates/default/globals.txt': Global symbol "$search_db" requires explicit package name at (eval 18) line 4. Global symbol "$search_db" requires explicit package name at (eval 18) line 5. Global symbol "$sth" requires explicit package name at (eval 18) line 6. Global symbol "$search_db" requires explicit package name at (eval 18) line 6. Global symbol "$sth" requires explicit package name at (eval 18) line 7. Global symbol "$Search" requires explicit package name at (eval 18) line 10. Global symbol "$results" requires explicit package name at (eval 18) line 11. Global symbol "$Search" requires explicit package name at (eval 18) line 12. Global symbol "$in" requires explicit package name at (eval 18) line 13. Global symbol "%LINKS" requires explicit package name at (eval 18) line 14. Missing right curly or square bracket at (eval 18) line 24, at end of line (eval 18) has too many errors. at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Template.pm line 71. ).Links (26290): GT::Config::error called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Config.pm line 491 with arguments (GT::Config, CANT_COMPILE_CODE, FATAL, [undef], /home/virtual/site315/fst/var/www/cgi-bin/links/admin/templates/default/globals.txt, Global symbol "$search_db" requires explicit package name at (eval 18) line 4. Global symbol "$search_db" requires explicit package name at (eval 18) line 5. Global symbol "$sth" requires explicit package name at (eval 18) line 6. Global symbol "$search_db" requires explicit package name at (eval 18) line 6. Global symbol "$sth" requires explicit package name at (eval 18) line 7. Global symbol "$Search" requires explicit package name at (eval 18) line 10. Global symbol "$results" requires explicit package name at (eval 18) line 11. Global symbol "$Search" requires explicit package name at (eval 18) line 12. Global symbol "$in" requires explicit package name at (eval 18) line 13. Global symbol "%LINKS" requires explicit package name at (eval 18) line 14. Missing right curly or square bracket at (eval 18) line 24, at end of line (eval 18) has too many errors. ).Links (26290): GT::Template::load_vars called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Template.pm line 71 with arguments (GT::Template=HASH(0x85a59a8), GT::CGI=HASH(0x828c1b0), GT::Config=HASH(0x828d20c), HASH(0x850ef88)).Links (26290): GT::Template::parse called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links.pm line 291 with arguments (GT::Template, subcategory.html, ARRAY(0x8551838), HASH(0x82f4768)).Links (26290): Links::user_page called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links/SiteHTML.pm line 182 with arguments (subcategory.html, HASH(0x850ef88), HASH(0x82f4768)).Links (26290): Links::SiteHTML::site_html_print_cat called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 97 with arguments (ARRAY(0x84ae180), [undef]).Links (26290): GT::Plugins::dispatch called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links/SiteHTML.pm line 28 with arguments (GT::Plugins, /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Plugins, site_html_print_cat, *Links::SiteHTML::site_html_print_cat, ARRAY(0x84ae180), [undef]).Links (26290): Links::SiteHTML::display called at (eval 1) line 18 with arguments (print_cat, ARRAY(0x84ae180)).Links (26290): Links::Build::build_home called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 102 with arguments (HASH(0x82f4a80)).Links (26290): GT::Plugins::dispatch called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links/Build.pm line 30 with arguments (GT::Plugins, /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Plugins, build_home, *Links::Build::build_home, HASH(0x82f4a80)).Links (26290): Links::Build::build called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 77 with arguments (home, HASH(0x82f4a80)).Links (26290): Links::User::Page::generate_home_page called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Links/User/Page.pm line 53 with no arguments.Links (26290): Links::User::Page::handle called at /home/virtual/site315/fst/var/www/cgi-bin/links/admin/GT/Plugins.pm line 102 with no arguments.Links (26290): GT::Plugins::dispatch called at page.cgi line 25 with arguments (GT::Plugins, /home/virtual/site315/fst/var/www/cgi-bin/links/admin/Plugins, handle_page, CODE(0x826b498)).System Information======================================Perl Version: 5.006Links SQL Version: 2.1.0DBI.pm Version: 1.14Persistant Env: mod_perl (0) SpeedyCGI (0)@INC = /home/virtual/site315/fst/var/www/cgi-bin/links/admin /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .CGI INPUT======================================d => 1CGI Cookies======================================ADCYCLE_LOGIN => idleb|2865198|c1 => 27:33:1:1012517372:2274|6:26:1:1012444342:604|26:31:2:1012276908:480||||||||||||||||||i1 => 31:43:35:1013052493:2748|16:20:83:1012222281:690|6:26:83:1012222967:1454|27:33:83:1012203024:816|21:25:83:1012194534:788|20:24:83:1012222279:840|26:31:82:1012203024:828|7:11:83:1012194535:645|23:28:82:1012222951:634|15:19:82:1012222952:2441|13:17:19:1012222969:1208|||||||||||||||||||||||||i5 => 29:39:23:1012309239:550|||||||||||||||||||||||||||||||||||ENVIRONMENT======================================DOCUMENT_ROOT => /home/virtual/site315/fst/var/www/htmlGATEWAY_INTERFACE => CGI/1.1GT_TMPDIR => /home/virtual/site315/fst/var/www/cgi-bin/links/admin/tmpHTTP_ACCEPT => */*HTTP_ACCEPT_ENCODING => gzip, deflateHTTP_ACCEPT_LANGUAGE => en-us,ar;q=0.5HTTP_CONNECTION => Keep-AliveHTTP_COOKIE => i1=31:43:35:1013052493:2748|16:20:83:1012222281:690|6:26:83:1012222967:1454|27:33:83:1012203024:816|21:25:83:1012194534:788|20:24:83:1012222279:840|26:31:82:1012203024:828|7:11:83:1012194535:645|23:28:82:1012222951:634|15:19:82:1012222952:2441|13:17:19:1012222969:1208|||||||||||||||||||||||||; c1=27:33:1:1012517372:2274|6:26:1:1012444342:604|26:31:2:1012276908:480||||||||||||||||||; i5=29:39:23:1012309239:550|||||||||||||||||||||||||||||||||||; ADCYCLE_LOGIN=idleb|2865198|HTTP_HOST => www.2muslims.comHTTP_REFERER => http://www.2muslims.com/cgi-bin/links/admin/admin.cgi?page=home_nav.htmlHTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)PATH => /usr/local/bin:/usr/bin:/binQUERY_STRING => d=1REMOTE_ADDR => 68.59.199.13REMOTE_HOST => pcp01056742pcs.polcht01.tn.comcast.netREMOTE_PORT => 65235REQUEST_METHOD => GETREQUEST_URI => /cgi-bin/links/page.cgi?d=1SCRIPT_FILENAME => /home/virtual/site315/fst/var/www/cgi-bin/links/page.cgiSCRIPT_NAME => /cgi-bin/links/page.cgiSERVER_ADDR => 216.71.40.181SERVER_ADMIN => akattih@yahoo.comSERVER_NAME => www.2muslims.comSERVER_PORT => 80SERVER_PROTOCOL => HTTP/1.1SERVER_SOFTWARE => Apache/1.3.19 (Unix) (Red-Hat/Linux) mod_perl/1.24_01 PHP/4.0.6 FrontPage/5.0.2 mod_ssl/2.8.1 OpenSSL/0.9.6SITE_CGIROOT => /home/virtual/site315/fst/var/www/cgi-binSITE_HTMLROOT => /home/virtual/site315/fst/var/www/htmlSITE_ROOT => /home/virtual/site315/fstAny ideas?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Upgrading problem In reply to
Can you paste your globals.txt? Looks like there's a syntax error in there.

Adrian
Quote Reply
Re: [brewt] Upgrading problem In reply to
Hi

A sample is :



'cat_list' => 'sub {
# Displays the Father categories.
my ($output,$sth,$cat);
my $cat_db = $DB->table(\'Category\');
$cat_db->select_options ("ORDER BY $CFG->{build_category_sort}") if ($CFG->{build_category_sort});
$sth = $cat_db->select ( { FatherID => 0 } );
$root = [{}];
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display (\'print_cat\', $root );
}
return $output;
}',



'search_top5' => 'sub {
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.
$search_db = $DB->table(\'SearchLog\');
$search_db->select_options (\'ORDER BY Results DESC\', \'LIMIT 5\');
$sth = $search_db->select;
while (my $row = $sth->fetchrow_hashref) {
my $output = \'\';
my $term_q;
if ($Search->hits) {
foreach my $term (@{$results}) {
$term = $Search->array_to_hash($term);
$term_q = $in->escape($term->{Term});
$output .= qq~ <a href="$LINKS{db_cgi_url}/search.cgi?query=$term_q">${$term}{Term}</a> -
~;
}
}
else {
$output = "Sorry no one has Searched for anything yet.";
}
return $output;
}
',



'total_hits' => 'sub {
my ($total) = $DB->table(\'Links\')->select([\'SUM(Hits)\'])->fetchrow_array;
return $total;
}



All those Globals were working just fine with 2.05.. An according to the uprade.txt file there should not be any changes needed...
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Upgrading problem In reply to
...it's because Links SQL uses strict, and some of your variables aren't declared with my (), such as $search_db, $sth and $term etc

Last edited by:

RedRum: Feb 14, 2002, 4:41 AM
Quote Reply
Re: [RedRum] Upgrading problem In reply to
Hello

do you meqan that

'cat_list' => 'sub {
# Displays the Father categories.
my ($output,$sth,$cat);
my $cat_db = $DB->table(\'Category\');
$cat_db->select_options ("ORDER BY $CFG->{build_category_sort}") if ($CFG->{build_category_sort});
$sth = $cat_db->select ( { FatherID => 0 } );
$root = [{}];
while (my $cat = $sth->fetchrow_hashref) {
$output .= Links::SiteHTML::display (\'print_cat\', $root );
}
return $output;
}',



should be:

'cat_list' => 'sub {
# Displays the Father categories.
my ($output,$sth,$cat);
my (cat_db = $DB->table(\'Category\'))
$cat_db->select_options ("ORDER BY $CFG->{build_category_sort}") if ($CFG->{build_category_sort});
$sth = (cat_db->select ( { FatherID => 0 } ))
$root = [{}];
while (my $cat = $sth->fetchrow_hashref) {
$output .= (inks::SiteHTML::display (\'print_cat\', $root ))
}
return $output;
}',



The thing is most of those Globals were working in the old version and Alex did not mention any changes..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] Upgrading problem In reply to
Try changing:

Code:
'search_top5' => 'sub {
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.
$search_db = $DB->table(\'SearchLog\');
$search_db->select_options (\'ORDER BY Results DESC\', \'LIMIT 5\');
$sth = $search_db->select;
while (my $row = $sth->fetchrow_hashref) {
my $output = \'\';
my $term_q;
if ($Search->hits) {
foreach my $term (@{$results}) {
$term = $Search->array_to_hash($term);
$term_q = $in->escape($term->{Term});
$output .= qq~ <a href="$LINKS{db_cgi_url}/search.cgi?query=$term_q">${$term}{Term}</a> -
~;
}
}
else {
$output = "Sorry no one has Searched for anything yet.";
}
return $output;
}
',

To:

Code:
'search_top5' => 'sub {
# -----------------------------------------------
# Returns a list of the Top5 Searched terms.
my ($search_db,$sth,$output,$term_q);
$search_db = $DB->table(\'SearchLog\');
$search_db->select_options (\'ORDER BY Results DESC\', \'LIMIT 5\');
$sth = $search_db->select;
while (my $row = $sth->fetchrow_hashref) {
if ($Search->hits) {
foreach my $term (@{$results}) {
$term = $Search->array_to_hash($term);
$term_q = $in->escape($term->{Term});
$output .= qq~ <a href="$LINKS{db_cgi_url}/search.cgi?query=$term_q">${$term}{Term}</a> -
~;
}
}
else {
$output = "Sorry no one has Searched for anything yet.";
}
return $output;
}
',

Im not sure about $Search->term and $in->escape either. I think it should be $IN->escape and I can't see where $Search is defined.

Last edited by:

RedRum: Feb 14, 2002, 12:10 PM
Quote Reply
Re: [RedRum] Upgrading problem In reply to
Hi
Thanks RedRum for the help and time..
Still have the problem...
I deleted those trouble Globals and I will work on them later when Time allows..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory