Skip to content

Commit

Permalink
Fix owner privileges on photos created via uploading an archive. Fixe…
Browse files Browse the repository at this point in the history
…s bug #11503
  • Loading branch information
perlDreamer committed Mar 30, 2010
1 parent 5b35b8f commit 03eeefe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions lib/WebGUI/Asset/Wobject/GalleryAlbum.pm
Expand Up @@ -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 );

Expand All @@ -143,21 +144,22 @@ 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{\.[^.]+}{};

$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"),
});
Expand Down

0 comments on commit 03eeefe

Please sign in to comment.