From dcdd671b2c8934181154c6ddd62717b629d72e38 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 11 Jun 2010 20:18:48 -0700 Subject: [PATCH] Fix the pending flag, get a fresh copy of the photo asset under test. --- lib/WebGUI/Asset/File/GalleryFile.pm | 5 +---- t/Asset/File/GalleryFile/Photo/view.t | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index 78c59c720..640adbe05 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -524,10 +524,7 @@ sub getTemplateVars { $var->{ fileUrl } = $self->getFileUrl; $var->{ thumbnailUrl } = $self->getThumbnailUrl; - # Set a flag for pending files - if ( $self->status eq "pending" ) { - $var->{ 'isPending' } = 1; - } + $var->{ isPending } = $self->status eq "pending"; # Fix 'undef' vars since HTML::Template does inheritence on them for my $key ( qw( synopsis ) ) { diff --git a/t/Asset/File/GalleryFile/Photo/view.t b/t/Asset/File/GalleryFile/Photo/view.t index b98554c7c..a16763c69 100644 --- a/t/Asset/File/GalleryFile/Photo/view.t +++ b/t/Asset/File/GalleryFile/Photo/view.t @@ -73,7 +73,7 @@ my $nextPhoto skipAutoCommitWorkflows => 1, }); $versionTag->commit; -foreach my $asset ($gallery, $album) { +foreach my $asset ($gallery, $album, $photo) { $asset = $asset->cloneFromDb; } WebGUI::Test->addToCleanup($versionTag); @@ -110,7 +110,7 @@ my $testTemplateVars = { thumbnailUrl => $photo->getThumbnailUrl, numberOfComments => scalar @{ $photo->getCommentIds }, exifLoop => ignore(), # Tested elsewhere - isPending => ( $photo->get("status") eq "pending" ), + isPending => ( $photo->status eq "pending" ), firstFile_url => $previousPhoto->getUrl, firstFile_thumbnailUrl => $previousPhoto->getThumbnailUrl,