fix problems with gallery URLs. fixed disk space check. added error messages to photo template

This commit is contained in:
Doug Bell 2008-06-12 22:08:10 +00:00
parent 5b467483f5
commit 58417faf8a
9 changed files with 84 additions and 2 deletions

View file

@ -653,9 +653,15 @@ sub processCommentEditForm {
sub processPropertiesFromFormPost {
my $self = shift;
my $i18n = __PACKAGE__->i18n( $self->session );
my $form = $self->session->form;
my $errors = $self->SUPER::processPropertiesFromFormPost || [];
# Make sure we have the disk space for this
if ( !$self->getGallery->hasSpaceAvailable( $self->get( 'assetSize' ) ) ) {
push @{ $errors }, $i18n->get( "error no space" );
}
# Return if errors
return $errors if @$errors;
@ -668,6 +674,11 @@ sub processPropertiesFromFormPost {
} );
}
# Fix URLs
$self->update( {
url => $self->getParent->get( "url" ) . '/' . $self->session->url->urlize( $self->get( "menuTitle" ) )
} );
$self->requestAutoCommit;
return;