bugfix [ 1245765 ] Missing 'page not found' crashes settings

This commit is contained in:
JT Smith 2005-08-23 19:37:11 +00:00
parent 2372905928
commit d39e649906
3 changed files with 5 additions and 1 deletions

View file

@ -49,6 +49,7 @@ Removes asset from lineage, places it in clipboard state. The "gap" in the linea
sub cut {
my $self = shift;
return undef if ($self->getId eq $session{setting}{defaultPage} || $self->getId eq $session{setting}{notFoundPage});
WebGUI::SQL->beginTransaction;
WebGUI::SQL->write("update asset set state='clipboard-limbo' where lineage like ".quote($self->get("lineage").'%')." and state='published'");
WebGUI::SQL->write("update asset set state='clipboard', stateChangedBy=".quote($session{user}{userId}).", stateChanged=".time()." where assetId=".quote($self->getId));

View file

@ -96,6 +96,7 @@ Deletes an asset from tables and removes anything bound to that asset.
sub purge {
my $self = shift;
return undef if ($self->getId eq $session{setting}{defaultPage} || $self->getId eq $session{setting}{notFoundPage});
WebGUI::SQL->beginTransaction;
foreach my $definition (@{$self->definition}) {
WebGUI::SQL->write("delete from ".$definition->{tableName}." where assetId=".quote($self->getId));
@ -120,6 +121,7 @@ Removes asset from lineage, places it in trash state. The "gap" in the lineage i
sub trash {
my $self = shift;
return undef if ($self->getId eq $session{setting}{defaultPage} || $self->getId eq $session{setting}{notFoundPage});
WebGUI::SQL->beginTransaction;
WebGUI::SQL->write("update asset set state='trash-limbo' where lineage like ".quote($self->get("lineage").'%'));
WebGUI::SQL->write("update asset set state='trash', stateChangedBy=".quote($session{user}{userId}).", stateChanged=".time()." where assetId=".quote($self->getId));