|
From: Chris W. <la...@us...> - 2001-10-26 21:10:01
|
Update of /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler
In directory usw-pr-cvs1:/tmp/cvs-serv7306/OpenInteract/Handler
Modified Files:
Page.pm
Log Message:
if the page isn't found, throw a 314 error rather than displaying the notice ourselves
Index: Page.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/pkg/base_page/OpenInteract/Handler/Page.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Page.pm 2001/10/25 15:21:32 1.6
--- Page.pm 2001/10/26 21:09:55 1.7
***************
*** 196,200 ****
unless ( $page or $do_edit ) {
$R->{page}{content_type} = 'text/html';
! return $class->_notfound_message( $location );
}
--- 196,200 ----
unless ( $page or $do_edit ) {
$R->{page}{content_type} = 'text/html';
! $R->throw({ code => 314, system_msg => $location });
}
***************
*** 204,207 ****
--- 204,212 ----
if ( $do_edit ) {
+ $page ||= $R->page->new;
+
+ # If this is an editable doc, fetch the content, otherwise,
+ # mark it as non-editable to the form
+
if ( $class->_is_displayable( $page->{mime_type} ) ) {
$page->content;
***************
*** 211,215 ****
}
$R->DEBUG && $R->scrib( 1, "This page should be in an editable form" );
- $page ||= $R->page->new;
$page->{is_file} ||= 'yes' if ( $page->CONFIG->{default_storage} eq 'file' );
$params->{page} = $page;
--- 216,219 ----
***************
*** 465,477 ****
}
-
- sub _notfound_message {
- my ( $class, $location ) = @_;
- return <<NOTFOUND;
- <h2>Page Not Found</h2>
- <p>Could not find page with location you requested
- (<tt>$location</tt>). Did you mistype the address?</p>
- NOTFOUND
- }
1;
--- 469,472 ----
|