From 1bf24f26828e1a46ba9b6ab7c15302d5ab12bafb Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 14 Feb 2009 03:43:01 +0000 Subject: [PATCH] Make sure that the AssetDiscovery contentHandler was added to all config files. --- docs/changelog/7.x.x.txt | 1 + docs/upgrades/upgrade_7.6.11-7.6.12.pl | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0b159cb85..e427278f3 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,7 @@ - fixed #9677: no output from form helper template variable sticky.form and stick.label - fixed #9738: Gallery Title [TEMPLATE] - fixed #9739: Gallery Delete Album Template [TEMPLATE] + - fixed #9737: Upgrade Missed a Config Option 7.6.11 - fixed: Asset Manager can generate URLs that are too long diff --git a/docs/upgrades/upgrade_7.6.11-7.6.12.pl b/docs/upgrades/upgrade_7.6.11-7.6.12.pl index e6c1f9740..8e70c4ae1 100644 --- a/docs/upgrades/upgrade_7.6.11-7.6.12.pl +++ b/docs/upgrades/upgrade_7.6.11-7.6.12.pl @@ -22,6 +22,7 @@ use Getopt::Long; use WebGUI::Session; use WebGUI::Storage; use WebGUI::Asset; +use WebGUI::Utility qw/isIn/; my $toVersion = '7.6.12'; @@ -29,6 +30,7 @@ my $quiet; # this line required my $session = start(); # this line required +addAssetDiscoveryServiceAgain( $session ); # upgrade functions go here @@ -44,6 +46,27 @@ finish($session); # this line required # print "DONE!\n" unless $quiet; #} +#---------------------------------------------------------------------------- +sub addAssetDiscoveryServiceAgain { + my $session = shift; + print "\tAdding asset discovery service..." unless $quiet; + my @handlers = @{ $session->config->get('contentHandlers') }; + if (isIn( 'WebGUI::Content::AssetDiscovery', @handlers) ) { + print "Done.\n" unless $quiet; + return; + } + my @newHandlers = (); + foreach my $handler (@handlers) { + if ($handler eq 'WebGUI::Content::Operation') { + push @newHandlers, 'WebGUI::Content::AssetDiscovery'; + } + push @newHandlers, $handler; + } + $session->config->set('contentHandlers', \@newHandlers); + print "Done.\n" unless $quiet; +} + + # -------------- DO NOT EDIT BELOW THIS LINE --------------------------------