Fix owner privileges on photos created via uploading an archive. Fixes bug #11503

This commit is contained in:
Colin Kuskie 2010-03-29 20:43:55 -07:00
parent 5b35b8f3a6
commit 03eeefe13d
2 changed files with 6 additions and 3 deletions

View file

@ -5,6 +5,7 @@
- fixed #11496: No linkable RSS feeds from gallery
- fixed #11497: default profile settings
- fixed #11492: photo details
- fixed #11503: Gallery: Wrong owner after uploading of ZIP archives
7.9.1
- fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero)

View file

@ -118,6 +118,7 @@ sub addArchive {
my $properties = shift;
my $outputSub = shift || sub {};
my $gallery = $self->getParent;
my $session = $self->session;
my $archive = Archive::Any->new( $filename );
@ -143,7 +144,7 @@ sub addArchive {
my $class = $gallery->getAssetClassForFile( $filePath );
next unless $class; # class is undef for those files the Gallery can't handle
$self->session->errorHandler->info( "Adding $filename to album!" );
$session->errorHandler->info( "Adding $filename to album!" );
$outputSub->('Adding %s to album', $filename);
# Remove the file extension
$filename =~ s{\.[^.]+}{};
@ -151,13 +152,14 @@ sub addArchive {
$properties->{ className } = $class;
$properties->{ menuTitle } = $filename;
$properties->{ title } = $filename;
$properties->{ url } = $self->session->url->urlize( $self->getUrl . "/" . $filename );
$properties->{ ownerUserId } = $session->user->userId;
$properties->{ url } = $session->url->urlize( $self->getUrl . "/" . $filename );
my $asset = $self->addChild( $properties, undef, undef, { skipAutoCommitWorkflows => 1 } );
$asset->setFile( $filePath );
}
my $versionTag = WebGUI::VersionTag->getWorking( $self->session );
my $versionTag = WebGUI::VersionTag->getWorking( $session );
$versionTag->set({
"workflowId" => $self->getParent->get("workflowIdCommit"),
});