Backporting GalleryAlbum isHidden fix.

This commit is contained in:
Colin Kuskie 2009-01-29 17:14:46 +00:00
parent 1d0db51904
commit 6a9e65d7d3
3 changed files with 28 additions and 0 deletions

View file

@ -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

View file

@ -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 --------------------------------

View file

@ -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