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

Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9

Quote Reply
Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9
I keep this error when I go to my search page.
I am still using the 2.2.1, i can't upgrade because of the "fetchrow_hashref" error

It has to do with a search logs table


error

Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9


Stack Trace
======================================
Links (14529): Links::environment called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Links.pm line 524 with no arguments.
Links (14529): Links::fatal called at (eval 6) line 9 with arguments
(Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9.
).
Links (14529): Links::__ANON__ called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/GT/Template.pm line 899 with arguments
(HASH(0x83bbb88)).
Links (14529): GT::Template::_get_var called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/templates/default/compiled/search.html.compiled line 241 with arguments
(GT::Template=HASH(0x834f344), top_search_terms, 0, 1).
Links (14529): GT::Template::parsed_template called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/GT/Template.pm line 640 with arguments
(GT::Template=HASH(0x834f344)).
Links (14529): GT::Template::_parse called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/GT/Template.pm line 126 with arguments
(GT::Template=HASH(0x834f344), search.html, HASH(0x834f0e0)).
Links (14529): GT::Template::parse called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Links.pm line 385 with arguments
(GT::Template, search.html, ARRAY(0x83bf938), HASH(0x834f0e0)).
Links (14529): Links::user_page called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Links/SiteHTML.pm line 254 with arguments
(search.html, [undef], HASH(0x834f0e0)).
Links (14529): Links::SiteHTML::__ANON__ called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/GT/Plugins.pm line 112 with arguments
([undef], [undef]).
Links (14529): GT::Plugins::dispatch called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Links/SiteHTML.pm line 28 with arguments
(GT::Plugins, /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Plugins, site_html_search, CODE(0x8390f54), [undef], [undef]).
Links (14529): Links::SiteHTML::display called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Links/User/Search.pm line 58 with arguments
(search).
Links (14529): Links::User::Search::handle called at /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/GT/Plugins.pm line 112 with no arguments.
Links (14529): GT::Plugins::dispatch called at search.cgi line 25 with arguments
(GT::Plugins, /home/httpd/vhosts/xxxxxxxxxxxxxxx.com/cgi-bin/admin/Plugins, handle_search, CODE(0x80823f8)).



System Information
======================================
Perl Version: 5.008001
Links SQL Version: 2.2.0
DBI.pm Version: 1.37
Running under mod_perl: No
Running under SpeedyCGI: No
GT::SQL::error = Failed to execute query: 'SELECT * FROM SearchLog ORDER BY HitCount DESC LIMIT 15' Reason: Table 'coupons.SearchLog' doesn't exist
@INC =
/home/httpd/vhosts/xxxxxxxxxxxxx.com/cgi-bin/admin
/usr/lib/perl5/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/5.8.1
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl

Last edited by:

Abusaki: Apr 17, 2005, 7:12 AM
Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
i have a file called SearchLogs.def and a table in my database called SearchLogs, but the error talks about a Searchlog.def file, how is this possible

A fatal error has occured:
GT::SQL (16394): File '/home/httpd/vhosts/xxxxxxxx.com/cgi-bin/admin/defs/SearchLog.def' does not exist or the permissions are set incorrectly at (eval 6) line 5.

Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Quote:
Table 'coupons.SearchLog' doesn't exist <<<---- NO "S"


Somewhere it's looking for a SearchLog table, without the "s"


PUGDOG´┐Ż Enterprises, Inc.

The best way to contact me is to NOT use Email.
Please leave a PM here.
Quote Reply
Re: [pugdog] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Hi pupdog,
That is exactly what I don't get. I have the table with an "s" so why is it now looking for one with out it and where do I change that.
Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Hi,

Shoot over LSQL admin panel details, and I'll take a peek for you. It may (somehow) be in the plugin module itself.

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] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Sent it over to your email Andy
Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Hi,

All fixed =)

There were a couple of things;

1) Your top_search_terms global was referencing SearchLog, i.e without the 's'
2) Your global needed rewriting, as the fields didn't match up. It not looks like;

Code:
sub {

my (@output,$db,$sth);

$db = $DB->table('SearchLogs');
$db->select_options ('ORDER BY slog_hits DESC', 'LIMIT 15');
$sth = $db->select;

while (my $row = $sth->fetchrow_hashref) {
push @output, qq~<div style=padding:1><li> <a href="$CFG->{db_cgi_url}/search.cgi?query=$row->{slog_query}">$row->{slog_query}</a></div>~;
}
return $#output > -1 ? join('<br>', @output) : 'No terms yet!';

}

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] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Thanks a lot Andy,
I need to upgrade to the 3.0 do I need to back up the globals file as well before upgrading, and what else do I need to back up
Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
Error upgrading

the error ocurred here.


Adding table 'NewsletterSubscription'...
Okay!
Importing User Newsletter settings...

Error
An error occured:
Can't call method "fetchrow" on an undefined value at /home/httpd/vhosts/xxxxxxxxxxx.com/cgi-bin/admin/Links/Upgrade.pm line 518.
Quote Reply
Re: [Abusaki] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
What version are you upgrading from?

Adrian
Quote Reply
Re: [brewt] Can't call method "fetchrow_hashref" on an undefined value at (eval 6) line 9 In reply to
I just did a new install and used the old database, worked really well, just had to re upload the templates