From 03eeefe13deeaeff8b53d709b75f41c81221e42e Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 29 Mar 2010 20:43:55 -0700 Subject: [PATCH] Fix owner privileges on photos created via uploading an archive. Fixes bug #11503 --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/GalleryAlbum.pm | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e00f1a6a4..c74ace65d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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) diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index 2ecb0f75c..c63fdb29e 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -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"), });