diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 000905496..a74997c2b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -17,6 +17,7 @@ - structure: normalize signature of Asset::duplicate method - fix: Copying Collaboration System assets fails - fix: Collaboration System packages do not deploy + - fix: robots.txt returns wrong MIME type 7.0.7 - rfe: Image Management (funded by Formation Design Systems) diff --git a/docs/upgrades/upgrade_7.0.7-7.0.8.pl b/docs/upgrades/upgrade_7.0.7-7.0.8.pl index 40a17afd8..a49fd69fe 100644 --- a/docs/upgrades/upgrade_7.0.7-7.0.8.pl +++ b/docs/upgrades/upgrade_7.0.7-7.0.8.pl @@ -19,6 +19,7 @@ my $quiet; # this line required my $session = start(); # this line required +fixRobotsTxtMimeType($session); # upgrade functions go here @@ -32,7 +33,22 @@ finish($session); # this line required # # and here's our code #} +sub fixRobotsTxtMimeType { + my $session = shift; + print "\tFixing MIME type of robots.txt snippet.\n" unless $quiet; + my $asset = WebGUI::Asset->newByDynamicClass($session, 'pbrobot000000000000001'); + unless (defined $asset) { + print "\t\tCouldn't find it; skipping this.\n"; + return; + } + unless ($asset->isa('WebGUI::Asset::Snippet')) { + print "\t\tWrong asset class; skipping this.\n"; + return; + } + + $asset->update({mimeType => 'text/plain'}); +} # ---- DO NOT EDIT BELOW THIS LINE ----