From d39e649906ed2d68d54f8e9954dfd829e6f7f2ca Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 23 Aug 2005 19:37:11 +0000 Subject: [PATCH] bugfix [ 1245765 ] Missing 'page not found' crashes settings --- docs/changelog/6.x.x.txt | 3 ++- lib/WebGUI/AssetClipboard.pm | 1 + lib/WebGUI/AssetTrash.pm | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 75bab39cd..0cdf65743 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -1,8 +1,9 @@ 6.7.2 - fix [ 1265788 ] SyndicatedContent *not working* in 6.7.x - + - fix [ 1245765 ] Missing 'page not found' crashes settings 6.7.1 + - fix [ 1206046 ] function tinyMCE_WebGUI_Cleanup don't work - Fixed a fatal error with Redirects - Fixed a fatal error in the date field in the new pluggable forms system. - Fixed a nasty logout bug. diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm index dbe3e6a41..fe4d7dca3 100644 --- a/lib/WebGUI/AssetClipboard.pm +++ b/lib/WebGUI/AssetClipboard.pm @@ -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)); diff --git a/lib/WebGUI/AssetTrash.pm b/lib/WebGUI/AssetTrash.pm index e2c702c67..9d0ab3197 100644 --- a/lib/WebGUI/AssetTrash.pm +++ b/lib/WebGUI/AssetTrash.pm @@ -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));