diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index f8107c807..230c7a43a 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -25,6 +25,7 @@ - Fixed behaviour of the Encrypt Login setting, in such way that only the form post containing the login credentials is sent over https. After authentication the user is redirected to http. (Martin Kamerbeek / Procolix) + - fix: RSS From Parent assets should always be hidden from navigation 7.2.3 - fix: minor bug with new template vars in Auth::createAccount diff --git a/docs/upgrades/upgrade_7.2.3-7.3.0.pl b/docs/upgrades/upgrade_7.2.3-7.3.0.pl index 88ddf1773..4d1b42a7c 100644 --- a/docs/upgrades/upgrade_7.2.3-7.3.0.pl +++ b/docs/upgrades/upgrade_7.2.3-7.3.0.pl @@ -22,6 +22,7 @@ my $session = start(); # this line required addWikiAssets($session); deleteOldFiles($session); addFileFieldsToDataForm($session); +makeRSSFromParentAlwaysHidden($session); finish($session); # this line required #------------------------------------------------- @@ -115,6 +116,19 @@ EOT $session->config->addToArray('assets', 'WebGUI::Asset::Wobject::WikiMaster'); } +sub makeRSSFromParentAlwaysHidden { + my $session = shift; + print "\tHiding RSS From Parent assets.\n" unless $quiet; + + # Since it's internal anyway, might as well just do it directly to all the revisions. + $session->db->write($_) for(<<'EOT', + UPDATE assetData AS d INNER JOIN RSSFromParent AS r + ON d.assetId = r.assetId AND d.revisionDate = r.revisionDate + SET d.isHidden = 1 +EOT + ); +} + # ---- DO NOT EDIT BELOW THIS LINE ---- #------------------------------------------------- diff --git a/lib/WebGUI/Asset/RSSFromParent.pm b/lib/WebGUI/Asset/RSSFromParent.pm index 8e10f2206..b570b410b 100644 --- a/lib/WebGUI/Asset/RSSFromParent.pm +++ b/lib/WebGUI/Asset/RSSFromParent.pm @@ -57,6 +57,13 @@ sub definition { } #------------------------------------------------------------------- +sub update { + # Re-force isHidden to 1 on each update; these should always be hidden. + my $self = shift; + my $properties = shift; + $self->SUPER::update(+{%$properties, isHidden => 1}); +} + sub _escapeXml { my $text = shift; my %entities = ('<' => '<', '>' => '>', '"' => '"', "'" => "'");