[ic] cannot delete items?
Jürgen R. Plasser
plasser at hexagon.at
Tue Oct 7 12:45:24 EDT 2003
Hi all,
I am not able to delete items in the admin frontend of ic (both item.html
and item_edit.html). I can change item values and I can add new items, but
I cannot delete them (even new added items).
Any hints?
I use ic 4.9.8 on a RH 7.2 linux box with mySQL.
Here ist the error.log (but this is not very usefull to me) :
> aaa-bbb-ccc-ddd.adsl.ycn.com RyPpZiaT:xxx.com - [06/October/2003:18:19:15
> +0200] shop /cgi-bin/xshop/admin/ item.html Safe: Can't locate
> object method "delete_record" via package "Vend::Table::Shadow" (perhaps
> you forgot to lo ad "Vend::Table::Shadow"?) at
> /usr/lib/perl5/site_perl/5.6.1/i386-linux/Safe/Hole.pm line 78.
>>
>>
>> my $idp;
>> return unless delete $CGI->{deleterecords};
>> for(qw/ui_delete_id item_id/) {
>> next if ! $CGI->{$_};
>> $idp = $_;
>> last;
>> }
>>
>> # Log("using idp=$idp, value=$CGI->{$idp}");
>> return unless $idp;
>>
>> delete $Scratch->{ui_location};
>> $Config->{NoSearch} = '';
>>
>> my @deltables = split /[\s0,]/, $CGI->{ui_delete_tables};
>> unshift @deltables, $CGI->{mv_data_table};
>> my @out;
>> for(@{$CGI_array->{$idp}}) {
>> my $key = $_;
>> my $db;
>> for(@deltables) {
>> my ($t, $col) = split /:/, $_;
>> next unless $t;
>> if ( $Tag->if_mm('!tables', "$t=d") ) {
>> push @errors,
>> errmsg("Not authorized to
>> delete from table %s", $t);
>> next;
>> }
>> unless ($db = $Db{$t}) {
>> push @errors, errmsg("Table %s not
>> available.", $t); next;
>> }
>> if($col) {
>> next unless length ($key);
>> $key = $db->quote($key, $col);
>> my $num = $db->query("delete from
>> $t where $col = $key"); if($num >
>> 0) {
>> push @out, errmsg(
>> "d
>> el
>> et
>> ed
>> %s
>> re
>> co
>> rd
>> s
>> fr
>> om
>> %s
>> wh
>> er
>> e
>> %s
>> =
>> %s
>> ",
>> $n
>> um,
>> $t,
>> $c
>> ol,
>> $k
>> ey,
>> );
>> }
>> else {
>> push @errors, errmsg(
>>
"No records in
>>
%s where %s =
>>
%s", $t, $col,
>>
$key, );
>> }
>> }
>> else {
>> next unless
>> $db->record_exists($key);
>> $db->delete_record($key) or do {
>> push @errors, $@;
>> next;
>> };
>> push @out, errmsg("Deleted %s from
>> %s", $key, $t); }
>> }
>> }
>> if(@errors) {
>> my $str = '<ul><li>';
>> $str .= join '<li>', @errors;
>> $str .= '</ul>';
>> $Tag->error({ name => 'db_maintenance', set =>
>> $str }); }
>> if(@out) {
>> my $str = '<ul><li>';
>> $str .= join '<li>', @out;
>> $str .= '</ul>';
>> $Tag->warnings($str);
>> }
>> return;
--
__ DI Jürgen R. Plasser * *** ***** ****** ********* plasser at hexagon.at
/ \ HEXAGON EDV-Dienstleistungen | A-4221 Steyregg | Weissenwolffstraße 14
\__/ www.hexagon.at | info at hexagon.at | Internet | ASP | Security | Software
There are two ways of constructing a software design. One is to make it so
simple that there are obviously no deficiencies; the other is to make it
so complicated that there are no obvious deficiencies. The first method is
far more difficult. (C. A. R. Hoare)
More information about the interchange-users
mailing list