From 6a9e65d7d30ba7bd0648d782082db1004677c94a Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Jan 2009 17:14:46 +0000 Subject: [PATCH] Backporting GalleryAlbum isHidden fix. --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.6.10-7.6.11.pl | 13 +++++++++++++ lib/WebGUI/Asset/Wobject/GalleryAlbum.pm | 14 ++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index da2657594..b123d2c63 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -2,6 +2,7 @@ - fixed: Syndicated Content asset doesn't work with feeds that specify their encodings via HTTP headers - fixed #9375: Syndicated Content asset improperly decodes wide XML entities - fixed #9592: DataForm deleteAttachedFiles method can crash + - fixed #9580: Gallery: albums shown in navigation 7.6.10 - fixed #9577: WebGUI::Form::Url::getValue returns blank rather than undef for blank fields diff --git a/docs/upgrades/upgrade_7.6.10-7.6.11.pl b/docs/upgrades/upgrade_7.6.10-7.6.11.pl index 8f53139b2..88966e39f 100644 --- a/docs/upgrades/upgrade_7.6.10-7.6.11.pl +++ b/docs/upgrades/upgrade_7.6.10-7.6.11.pl @@ -22,6 +22,7 @@ use Getopt::Long; use WebGUI::Session; use WebGUI::Storage; use WebGUI::Asset; +use WebGUI::Asset::Wobject::GalleryAlbum; my $toVersion = '7.6.11'; @@ -29,6 +30,7 @@ my $quiet; # this line required my $session = start(); # this line required +hideGalleryAlbums($session); # upgrade functions go here @@ -44,6 +46,17 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +sub hideGalleryAlbums { + my $session = shift; + print "\tHiding all Gallery Albums from Navigation... " unless $quiet; + # and here's our code + my $getAnAlbum = WebGUI::Asset::Wobject::GalleryAlbum->getIsa($session); + while (my $album = $getAnAlbum->()) { + $album->update({}); ##The album will do the hiding automatically now + } + print "DONE!\n" unless $quiet; +} # -------------- DO NOT EDIT BELOW THIS LINE -------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm index e3fc6bef8..88ab9d778 100644 --- a/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm +++ b/lib/WebGUI/Asset/Wobject/GalleryAlbum.pm @@ -752,6 +752,20 @@ sub sendChunkedContent { #---------------------------------------------------------------------------- +=head2 update ( ) + +Override update to force isHidden=1 on all albums. + +=cut + +sub update { + my $self = shift; + my $properties = shift; + return $self->SUPER::update({ %{ $properties }, isHidden=>1 }); +} + +#---------------------------------------------------------------------------- + =head2 view ( ) method called by the www_view method. Returns a processed template