Gossamer Forum
Home : Products : Others : MySQLMan :

can't delete after table search/select

Quote Reply
can't delete after table search/select
Interesting problem here...I can delete records from my tables when I am just browsing, but if I search (select) for a set of records the program bails out when I try to delete a record. I have pasted an example error below, after removing my server config info, resulting from hitting the "delete" link after doing a table search. Not real worried about it, just seems odd. Aside from the spelling error I'm not sure what the error message means.

cheers,

Michael

#######################


CGI ERROR
==========================================
Error Message : modify action cannot be idenfied
Script Location : mysql.cgi
Perl Version : 5.00404

Form Variables
-------------------------------------------
data_source :
do : modify
example : fname
fields : id,fname,lname,email,position,affiliation,address1,address2,city,state,zip,country,code,phone,fax,url,timestamp,list
page : 1
sort_index : id
table : users
where :

Stack Trace
-------------------------------------------
(main::cgierr) called from (mysql.cgi) line (714)

(main::table_modify) called from (mysql.cgi) line (104)

(main::main) called from (mysql.cgi) line (70)

((eval)) called from (mysql.cgi) line (70)

seaturtle.org
Quote Reply
Re: can't delete after table search/select In reply to
Oops~ Sorry about the typo in the error message. It'll be fixed. =P

The message is displayed when the system knows that you would like to modify records in the table but the action cannot be identified. The actions include

drop_table
empty_table
delete_record
edit_record / update

Could you please let me know the steps you took to arrive at the error message?

Cheers,

--
Gossamer Threads, Inc.
Quote Reply
Re: can't delete after table search/select In reply to
OK, I have mysqlman using the new autologin feature. I "select" from one of my tables. Enter a query and submit. It returns a found set. Now if I click "edit" for one of the records I get the error message I mentioned before.

If I simply "browse" a table and navigate to the record I want page by page, I can then edit records without a problem.

Does that make sense?

Michael
--------

seaturtle.org
Quote Reply
Re: can't delete after table search/select In reply to
Could you please copy-and-paste both "sub table_modify" and "sub table_browse" from your mysql.cgi to a text file and put the file in a publicly accessible directory?

--
Gossamer Threads, Inc.
Quote Reply
Re: can't delete after table search/select In reply to
Sure, the subs in question are posted at http://www.seaturtle.org/subs.txt. However, should be the same as the original code (v. 1.02) as I have not modified mysql.cgi.

Michael

seaturtle.org
Quote Reply
Re: can't delete after table search/select In reply to
Has this been resolved? I have the same problem, and I think it's only in Netscape. I believe it has to do with spaces in the query string not being converted to

Internet Explorer corrects for this automatically, but Netscape does not. I have not gotten into looking for the actual cause of this, but I thought I'd share what I think I know about it so far.


Quote Reply
Re: can't delete after table search/select In reply to
Sorry. The spaces should be converted to (percentsign)20

Quote Reply
Re: [jaymuntz] can't delete after table search/select In reply to
Hi,

I use Netspace and I've been getting the same errors (v1.09) when trying to delete a record after a search. Having looked at the scripts I've found the following solution:

Edit /mysqlman/GT/CGI.pm - and replace this:

sub html_escape {
#--------------------------------------------------------------------------------
# Return the string html_escaped.
#
my $toencode = (defined $_[0] and ((ref $_[0] eq 'GT::CGI') or ($_[0] eq 'GT::CGI'))) ? $_[1] : $_[0];
return unless (defined $toencode);
if (ref($toencode) eq 'SCALAR') {
$$toencode =~ s/&/&/g;
$$toencode =~ s/</&lt;/g;
$$toencode =~ s/>/&gt;/g;
$$toencode =~ s/"/&quot;/g;
}
else {
$toencode =~ s/&/&amp;/g;
$toencode =~ s/</&lt;/g;
$toencode =~ s/>/&gt;/g;
$toencode =~ s/"/&quot;/g;
}
return $toencode;
}

... with this ...

sub html_escape {
#--------------------------------------------------------------------------------
# Return the string html_escaped.
#
my $toencode = (defined $_[0] and ((ref $_[0] eq 'GT::CGI') or ($_[0] eq 'GT::CGI'))) ? $_[1] : $_[0];
return unless (defined $toencode);
if (ref($toencode) eq 'SCALAR') {
$$toencode =~ s/&/&amp;/g;
$$toencode =~ s/</&lt;/g;
$$toencode =~ s/>/&gt;/g;
$$toencode =~ s/"/&quot;/g;
$$toencode =~ s/ /%20/g;
}
else {
$toencode =~ s/&/&amp;/g;
$toencode =~ s/</&lt;/g;
$toencode =~ s/>/&gt;/g;
$toencode =~ s/"/&quot;/g;
$toencode =~ s/ /%20/g;
}
return $toencode;
}

This makes the delete URL encode properly for the browser.

My only question is - would this change effect any of the other functions of MySQLMan?

All the best
Shaun

Last edited by:

qango: Jan 25, 2002, 3:45 AM
Quote Reply
Re: [qango] can't delete after table search/select In reply to
Hi,

The proper fix I think is to change whatever calls html_escape() to use escape() instead.

I'll see if I can track this down.

Cheers,

Alex
--
Gossamer Threads Inc.