From: Chris W. <la...@us...> - 2005-03-11 05:37:43
|
Update of /cvsroot/openinteract/OpenInteract2/pkg/base_page/OpenInteract2/Action In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv959/OpenInteract2/Action Modified Files: Page.pm Log Message: OIN-87: check to see if a page will overlap with an existing action before saving it (prevents orphaned pages) Index: Page.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/pkg/base_page/OpenInteract2/Action/Page.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Page.pm 10 Jan 2005 15:14:23 -0000 1.24 --- Page.pm 11 Mar 2005 05:37:31 -0000 1.25 *************** *** 539,542 **** --- 539,550 ---- $log->debug( "Location after clean '$page->{location}'" ); + # Ensure this page is viewable + if ( $page_class->does_url_exist_as_action( $page->{location} ) ) { + $self->add_error_key( 'base_page.error.location_is_used', $page->{location} ); + my $redo_task = ( $self->param( 'c_task' ) eq 'add' ) + ? 'display_add' : 'display_form'; + die $self->execute({ task => $redo_task }); + } + $page->{expires_on} ||= DateTime->now + DEFAULT_EXPIRE; $page->{mime_type} ||= 'text/html'; |