fixes to the Gallery

This commit is contained in:
Doug Bell 2007-12-18 21:17:44 +00:00
parent 99274cd4ee
commit 53a1cbc7c2
8 changed files with 72 additions and 27 deletions

View file

@ -165,6 +165,19 @@ sub appendTemplateVarsFileLoop {
#----------------------------------------------------------------------------
=head2 canAdd ( )
Override canAdd to ignore its permissions check. Permissions are handled
by the parent Gallery and other permissions methods.
=cut
sub canAdd {
return 1;
}
#----------------------------------------------------------------------------
=head2 canAddFile ( [userId] )
Returns true if the user can add a file to this album. C<userId> is a WebGUI
@ -467,12 +480,20 @@ approval workflow.
sub processPropertiesFromFormPost {
my $self = shift;
my $form = $self->session->form;
my $errors = $self->SUPER::processPropertiesFromFormPost || [];
# Return if error
return $errors if @$errors;
# Passes all checks
### Passes all checks
# Fix if adding a new GalleryAlbum
if ( $form->get('assetId') eq "new" ) {
$self->update({
ownerUserId => $self->session->user->userId,
});
}
$self->requestAutoCommit;
}