diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 2832718d7..1d381fa91 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -10,6 +10,7 @@ - fixed #9356: Data Form Mail Fields - fixed #9365: Account: when viewing another person's contribution, it displays my name - fixed #9351: Cannot translate phrase + - fixed #9368: Gallery: All children included into navigation 7.6.7 - fixed #9263: Thingy possibleValues processing, and List type autodetection. diff --git a/docs/upgrades/upgrade_7.6.7-7.6.8.pl b/docs/upgrades/upgrade_7.6.7-7.6.8.pl index 2b03b87f7..0b5fe5e02 100644 --- a/docs/upgrades/upgrade_7.6.7-7.6.8.pl +++ b/docs/upgrades/upgrade_7.6.7-7.6.8.pl @@ -20,6 +20,7 @@ use Getopt::Long; use WebGUI::Session; use WebGUI::Storage; use WebGUI::Asset; +use WebGUI::Asset::File::GalleryFile; use WebGUI::Shop::Pay; use WebGUI::Shop::PayDriver; @@ -32,6 +33,7 @@ my $session = start(); # this line required # upgrade functions go here setDefaultItransactCredentialTemplate($session); +hideGalleryPhotos($session); finish($session); # this line required @@ -56,6 +58,19 @@ sub setDefaultItransactCredentialTemplate { print "DONE!\n" unless $quiet; } +#---------------------------------------------------------------------------- +# Describe what our function does +sub hideGalleryPhotos { + my $session = shift; + print "\tSet the isHidden bit in all Photos so your navigations do not blow up... " unless $quiet; + # and here's our code + my $getAPhoto = WebGUI::Asset::File::GalleryFile->getIsa($session); + while (my $photo = $getAPhoto->()) { + $photo->update(isHidden => 1); + } + print "DONE!\n" unless $quiet; +} + #---------------------------------------------------------------------------- # Describe what our function does #sub exampleFunction { diff --git a/lib/WebGUI/Asset/File/GalleryFile.pm b/lib/WebGUI/Asset/File/GalleryFile.pm index 8fb6621f1..f5033cc63 100644 --- a/lib/WebGUI/Asset/File/GalleryFile.pm +++ b/lib/WebGUI/Asset/File/GalleryFile.pm @@ -739,6 +739,21 @@ sub setComment { ); } +#################################################################### + +=head2 update + +Wrap update so that isHidden is always set to be a 1. + +=cut + +sub update { + my $self = shift; + my $properties = shift; + return $self->SUPER::update({%$properties, isHidden => 1}); +} + + #---------------------------------------------------------------------------- =head2 view ( )