fix problems with gallery URLs. fixed disk space check. added error messages to photo template
This commit is contained in:
parent
5b467483f5
commit
58417faf8a
9 changed files with 84 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -506,6 +506,15 @@ sub www_edit {
|
|||
url_addArchive => $self->getParent->getUrl('func=addArchive'),
|
||||
url_album => $self->getParent->getUrl('func=album'),
|
||||
};
|
||||
|
||||
# Process errors if any
|
||||
if ( $session->stow->get( 'editFormErrors' ) ) {
|
||||
for my $error ( @{ $session->stow->get( 'editFormErrors' ) } ) {
|
||||
push @{ $var->{ errors } }, {
|
||||
error => $error,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
if ( $form->get('func') eq "add" ) {
|
||||
$var->{ isNewPhoto } = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue