This commit is contained in:
JT Smith 2004-10-30 16:45:17 +00:00
parent 9cffe191ac
commit dbc29d5d11

View file

@ -219,8 +219,8 @@ sub new {
#------------------------------------------------------------------- #-------------------------------------------------------------------
sub purge { sub purge {
my $sth = WebGUI::SQL->read("select forumId,pageId from USS_submission where USS_id=".quote($_[0]->get("USS_id"))); my $sth = WebGUI::SQL->read("select forumId,pageId,USS_submissionId from USS_submission where USS_id=".quote($_[0]->get("USS_id")));
while (my ($forumId, $pageId) = $sth->array) { while (my ($forumId, $pageId,$submissionId) = $sth->array) {
my ($inUseElsewhere) = WebGUI::SQL->quickArray("select count(*) from USS_submission where forumId=".quote($forumId)); my ($inUseElsewhere) = WebGUI::SQL->quickArray("select count(*) from USS_submission where forumId=".quote($forumId));
unless ($inUseElsewhere > 1) { unless ($inUseElsewhere > 1) {
my $forum = WebGUI::Forum->new($forumId); my $forum = WebGUI::Forum->new($forumId);
@ -230,8 +230,7 @@ sub purge {
if (defined $page) { if (defined $page) {
$page->purge; $page->purge;
} else { } else {
WebGUI::ErrorHandler::warn("Submission ".$submissionId." WebGUI::ErrorHandler::warn("Submission ".$submissionId." of USS ".$_[0]->get("USS_id")." didn't have real page attached to it. This could be a minor problem caused by a bug of old, or it could indicate major data corruption issues.");
of USS ".$_[0]->get("USS_id")." didn't have real page attached to it. This could be a minor problem caused by a bug of old, or it could indicate major data corruption issues.");
} }
} }
$sth->finish; $sth->finish;