From e6818b58fc9ccbb1ff95c8aaae6a9f4e277961bb Mon Sep 17 00:00:00 2001 From: JT Smith Date: Fri, 24 Sep 2004 16:09:32 +0000 Subject: [PATCH] bug fixes --- docs/changelog/6.x.x.txt | 4 ++++ lib/WebGUI/Operation/Page.pm | 15 +++++++++++---- lib/WebGUI/Page.pm | 2 +- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 16bbe31fb..2b66fd004 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -9,6 +9,10 @@ - Fixed a problem where hidden form tags were not escaping macros properly. - Fixed an XHTML problem with hidden form tags. - Bugfix [ 1033561 ] HTMLArea 3 not working (Len Kranendonk) + - Fixed a paste page problem. + - Fixed a problem with the new export mechanism where it would just stop and + not report an error if it ran into a problem with creating folders and + files. 6.2.4 diff --git a/lib/WebGUI/Operation/Page.pm b/lib/WebGUI/Operation/Page.pm index 3bdd12fcf..bc8d1879a 100644 --- a/lib/WebGUI/Operation/Page.pm +++ b/lib/WebGUI/Operation/Page.pm @@ -726,7 +726,8 @@ sub www_exportPageGenerate { $path = $session{config}{exportPath} . $session{os}{slash} . $path; eval { mkpath($path) }; if($@) { - print "Couldn't create $path: $@"; + print "Couldn't create $path because $@
\n"; + print "This most likely means that you have a page with the same name as folder that you're trying to create.
\n"; return; } } @@ -741,9 +742,15 @@ sub www_exportPageGenerate { ); # Open file $file = $session{config}{exportPath} . $session{os}{slash} . $page->{urlizedTitle}; - open(FILE, "> $file") || die "Can't open $file: $!"; - print FILE $e->generate; - close(FILE); + eval { open(FILE, "> $file") or die "$!" }; + if ($@) { + print "Couldn't open $file because $@
\n"; + print "This most likely means that you have created a page with the same name as an existing folder.
\n"; + return; + } else { + print FILE $e->generate; + close(FILE); + } print "DONE
"; } diff --git a/lib/WebGUI/Page.pm b/lib/WebGUI/Page.pm index 1e780e16c..e7108266d 100644 --- a/lib/WebGUI/Page.pm +++ b/lib/WebGUI/Page.pm @@ -1294,7 +1294,7 @@ sub paste{ ($self, $newMother) = @_; # You do not want to paste a page onto itself, believe me. - return $self if ($self->get("pageId") == $newMother->get("pageId")); + return $self if ($self->get("pageId") eq $newMother->get("pageId")); return WebGUI::ErrorHandler::fatalError("You cannot paste a page that's not on the clipboard. parentId:". $self->get("parentId").", pageId:".$self->get("pageId")) unless ($self->get("parentId") == 2);