Gossamer Forum
Quote Reply
Modifying...
I've just stumbled across a problem when writing a plugin. Basically, it seems that the Modify function does not work correctly. I am defining LinkID in the query string, so the old URL does not need to be entered.

It is holding the LinkID value correctly;

<input type="hidden" name="LinkID" value="27">

...but after submitting when the modification was made, I get;


------------------------------------------------------------
A fatal error has occured:
Can't call method "rows" on an undefined value at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links/User/Modify.pm line 166.

Please enable debugging in setup for more details.
Stack Trace
======================================
Links (67043): Links::environment called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links.pm line 431 with no arguments.
Links (67043): Links::fatal called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links/User/Modify.pm line 166 with arguments
    (Can't call method "rows" on an undefined value at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links/User/Modify.pm line 166.
        ).
Links (67043): Links::User::Modify::modify_link called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/GT/Plugins.pm line 91 with arguments
    (HASH(0x824340c)).
Links (67043): GT::Plugins::dispatch called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links/User/Modify.pm line 47 with arguments
    (GT::Plugins, /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Plugins, user_modify_link, CODE(0x81c9228), HASH(0x824340c)).
Links (67043): Links::User::Modify::_modify called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Links/User/Modify.pm line 32 with no arguments.
Links (67043): Links::User::Modify::handle called at /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/GT/Plugins.pm line 91 with no arguments.
Links (67043): GT::Plugins::dispatch called at modify.cgi line 25 with arguments
    (GT::Plugins, /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/Plugins, handle_modify, CODE(0x81aaae8)).


System Information
======================================
Perl Version: 5.00503
Links SQL Version: 2.1.2
DBI.pm Version: 1.21
Persistant Env: mod_perl (0) SpeedyCGI (0)
GT::SQL::error = Failed to execute query: 'SELECT * FROM Links WHERE IS NULL ' Reason: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'IS NULL' at line 1
@INC =
/home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin
/usr/libdata/perl/5.00503/mach
/usr/libdata/perl/5.00503
/usr/local/lib/perl5/site_perl/5.005/i386-freebsd
/usr/local/lib/perl5/site_perl/5.005
.

CGI INPUT
======================================
CatLinks.CategoryID => 1
Contact_Email => ererer
Contact_Name => andy
Description => just a test dewdc
LinkID => 27
Title => new tsting title
URL => http://www.crap.com
d => 1
modify => 1
sample1 => C:\WINDOWS\Desktop\backups\linkssql.net\images\bg_content.jpg
sample2 => C:\WINDOWS\Desktop\backups\linkssql.net\images\fl3_07-link1_over.jpg
sample3 =>
sample4 =>
sample5 =>
sample6 =>
upload1 =>


CGI Cookies
======================================
MySQLMan_host => localhost
MySQLMan_password => ******
MySQLMan_url => mysql.cgi?table=Links;data_source=DBI%3Amysql%3Alsql2;do=browse;page=1;action=browse
MySQLMan_username => ******


ENVIRONMENT
======================================
CONTENT_LENGTH => 14966
CONTENT_TYPE => multipart/form-data; boundary=---------------------------7d31ea2f430
DOCUMENT_ROOT => /htdocs/rjones/linkssql.net
GATEWAY_INTERFACE => CGI/1.1
GT_TMPDIR => /home/htdocs/users/rjones/rjones/linkssql.net/cgi-bin/search/admin/tmp
HTTP_ACCEPT => */*
HTTP_ACCEPT_ENCODING => gzip, deflate
HTTP_ACCEPT_LANGUAGE => en-gb
HTTP_CACHE_CONTROL => no-cache
HTTP_CONNECTION => Keep-Alive
HTTP_HOST => www.linkssql.net
HTTP_REFERER => http://www.linkssql.net/cgi-bin/search/modify.cgi?d=1&LinkID=27
HTTP_USER_AGENT => Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
PATH => /usr/local/bin:/usr/bin:/bin
QUERY_STRING =>
REMOTE_ADDR => 172.187.108.111
REMOTE_PORT => 1476
REQUEST_METHOD => POST
REQUEST_URI => /cgi-bin/search/modify.cgi
SCRIPT_FILENAME => /htdocs/rjones/linkssql.net/cgi-bin//search/modify.cgi
SCRIPT_NAME => /cgi-bin/search/modify.cgi
SERVER_ADDR => 64.255.42.69
SERVER_ADMIN => webmaster@linkssql.net
SERVER_NAME => www.linkssql.net
SERVER_PORT => 80
SERVER_PROTOCOL => HTTP/1.1
SERVER_SOFTWARE => Apache/1.3.27 (Unix) PHP/4.3.0 mod_ssl/2.8.10 OpenSSL/0.9.6e

------------------------------------------------------------

The bit in red is obviously the problematic code, but I can't see any reason in /admin/Links/Users/Modify.pm for it to be brining up these errors. The place think the error is being reported is;

Code:
my ($link, $sth);
if ($USER and $lid) {
$sth = $db->select ( { ID => $lid, LinkOwner => $USER->{Username} });
$sth->rows or return { error => Links::language('MODIFY_BADURL', $lid), Category => $category, LinkID => $lid };
}
else {
$sth = $db->select ( { $column => $value } );
$sth->rows or return { error => Links::language('MODIFY_BADURL', $value), Category => $category, LinkID => $lid };
}
$link = $sth->fetchrow_hashref;

Could it be down to the fact the select does not seem to be setup correctly?

select ( { $column => $value } )

...shouldn't it be;

select ( { URL => $IN->param('URL') } );

I'm totally confused Unimpressed

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!
Subject Author Views Date
Thread Modifying... Andy 3972 Jun 21, 2003, 5:08 AM
Thread Re: [Andy] Modifying...
Andy 3855 Jun 24, 2003, 12:42 AM
Thread Re: [Andy] Modifying...
Andy 3845 Jun 25, 2003, 4:19 AM
Thread Re: [Andy] Modifying...
Aki 3814 Jul 2, 2003, 8:53 AM
Post Re: [Aki] Modifying...
Andy 3781 Jul 2, 2003, 9:03 AM
Thread Re: [Aki] Modifying...
Andy 3793 Jul 2, 2003, 9:17 AM
Post Re: [Andy] Modifying...
Aki 3761 Jul 3, 2003, 3:01 PM
Thread Re: [Andy] Modifying...
cdkrg 3627 Nov 26, 2003, 12:13 AM
Post Re: [cdkrg] Modifying...
Andy 3631 Nov 26, 2003, 12:56 AM