[ic] read only error submit review

TheRealPiccolo at gmx.de TheRealPiccolo at gmx.de
Mon Mar 15 07:58:36 EST 2004


Hi,

I searched the mailing list for my Problem but I couldn´t find a sulotion.

To my Problem:
I get this error, when I´m going to submit a review for a product:
(table forum): Attempt to set slice of in read-only table forum 

the error.log says:
foundation /cgi-bin/foundation/forum/reply.html Attempt to set slice of  in
read-only table forum
foundation /cgi-bin/foundation/forum/reply.html Safe: syntax error at (eval
3348) line 1, near "(,"

I just can´t find the error!  

here´s my reply.html:

[flag type=write table=forum]
[tmp page_title]Reply to [data table=forum col=subject key="[data session
arg]"][/tmp]

[if cgi product]
	[if type=!data term="forum:code:[data session arg]"]
		[perl tables="forum products"]
			my $db = $Db{forum};
			my $code = $Session->{arg};
			my $desc = tag_data('products', 'description', $code);
			my $parent = 0;
			if($CGI->{subsidiary}) {
				$parent = $CGI->{subsidiary};
			}
			return unless $desc;
			my $record = {
				created => $Tag->convert_date( { fmt => '%Y%m%d%H%M' }),
				artid => $code,
				subject => "Comments on $desc",
				username => "interch",
				name => "Product Manager",
				email => $Variable->{FORUM_EMAIL_NOTIFY} || '',
				score => 1,
				comment => "",
				parent => $parent,
			};
			$db->set_slice($code, $record);
			return;
		[/perl]
	[/if]
[/if]

<div align=left>
[if !cgi operation]
	[loop list="[data session arg]" prefix=item]
	[if-item-data forum code]
	<table>
	<tr>
	<td bgcolor="#eeeeee">
	    <b>[item-data forum subject]</b>
	    <small>[if-item-data forum score](Score: [item-data forum
score][if-item-data forum reason], [item-data forum reason][/if-item-data])[/if-item-data]

		by <b>[forum-userlink
			username="[item-data forum username]"
			name="[item-data forum name]"
			anon="[item-data forum anon]"
		]</b> on [convert-date fmt="%A, %B %e, %Y @%H:%M"][item-data forum
created][/convert-date]</small>
        </li>

	</td>
	</tr>
	<tr>
	<td>
		[item-data forum comment]
	</td>
	</tr>
[if-item-data forum additional]
	<tr>
	<td>
		[item-data forum additional]
	</td>
	</tr>
[/if-item-data]
	<tr>
	<td>
	<hr>
	<B>You are replying to the above.</b>
	</td>
	</tr>
	</table>
	[/if-item-data]
	[/loop]
[/if]

[if cgi operation eq '[L]Preview[/L]']

	<table>
	<tr>
	<td class=contentbar1>
	<B>[cgi name=subject filter=restrict_html]<br>
	by 
		[if !session logged_in]
			[either]__FORUM_ANON_NAME__[or]Anonymous Coward[/either]
		[else]
			[if cgi anon]
			[either]__FORUM_ANON_NAME__[or]Anonymous Coward[/either]
			[else]
			[either][value handle][or][value fname][or][data session
username][/either]
			[/else]
			[/if]
		[/else]
		[/if]
	on [convert-date fmt="%A, %B %e, %Y @%H:%M"][/convert-date]</B>
	</td>
	</tr>
	<td>
	[if cgi commtype eq 2]
	[cgi name=comment filter="text2html" keep=1 enable_html=1]
	[elsif cgi commtype eq 4]
		<xmp>[cgi name=comment]</xmp>
	[/elsif]
	[else]
		[cgi name=comment
filter="restrict_html.a.b.i.u.blockquote.li.ol.ul.em.br.tt.p.strong.div" keep=1 enable_html=1]
	[/else]
	[/if]
	</td>
	</tr>
	</table>
<P>
Above is a preview of what you just entered. Use <b>Submit</b> to actually
submit if you are satisfied. 
</P>
[/if]

[if cgi operation eq '[L]Submit[/L]']

[flag type=write table=forum]
[perl tables="forum"]
	# code parent artid mod_time created username host score
	# lastscore reason anon extended subject comment
	my @allowed = qw/ a b i u blockquote li ol ul em br tt p strong div /;
	my %v;
	delete $Scratch->{tmp_code};
	my $db = $Db{forum}
		or return "Database error.";

	$v{host} = $Session->{host};
	$v{score} = 1;
	my $noscrub;
	if(! $CGI->{commtype}) {
		# do nothing
	}
	elsif($CGI->{commtype} eq '2') {
		$CGI->{comment} = $Tag->filter('text2html', $CGI->{comment});
	}
	elsif($CGI->{commtype} eq '4') {
		unless ($CGI->{comment} =~ m{</\s*xmp\s*>}i) {
			$noscrub = 1;
			$CGI->{comment} = "<XMP>$CGI->{comment}</XMP>";
		}
	}
	$v{comment} = $CGI->{comment};
	my $filter = join ".", 'restrict_html', @allowed;
	$v{comment} = $Tag->filter($filter,$v{comment})
		unless $noscrub;
	$v{username} = $Session->{username} || '';
	$v{anon} = $CGI->{anon} ? 1 : 0;
	$v{created} =
	$v{mod_time} = $Tag->time( { body => "%Y-%m-%d %H:%M:%S" });
#Debug("mod_time $v{mod_time}");
	$v{subject} =  $Tag->filter('encode_entities', $CGI->{subject}, 'subject');
	$v{artid} =  $CGI->{artid};

	$v{parent} =  $CGI->{parent};
	$Scratch->{tmp_code} = $db->set_slice(undef, [ keys %v ], [values %v])
		or return "Error submitting reply!";

	$Scratch->{tmp_code} =~ s/'//g;
	$Scratch->{tmp_parent} = $v{parent};

	my $mrecord = $db->row_hash($v{artid});

	## This is special processing only if main article ID record
	## is found
	if($mrecord and $mrecord->{email}) {
		my $cc = $mrecord->{email};
		my $url = $Tag->area(
								{ href => 'admin/flex_editor',
								  form => "
								  		mv_data_table=forum
								  		item_id=$Scratch->{tmp_code}
								  ",
								  });


		my $message = <<EOF;
Subject: $v{subject}
From: $v{name} <$v{email}>
Host: $v{host}

$v{comment}

Edit/delete:

	$url
EOF

		$Tag->email( {
					subject => "Posting from $v{artid} forum: $v{subject}",
					to => $cc,
					body => $message,
					});

	}

	return;
[/perl]

	[if scratch tmp_code]
		[bounce href="[area href=forum/display arg='[scratch tmp_parent]']"]
	[/if]
[else]
	[include include/forum/reply_form]
[/else]
[/if]

<P>

[if variable FORUM_DEFAULT_THREAD]
[page forum __FORUM_DEFAULT_THREAD__]__COMPANY__ forum[/page]
[/if]



-- 
+++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++
100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz



More information about the interchange-users mailing list