diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 923790e1e..e69e7afa8 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -30,6 +30,8 @@ - Fixed a bad module name in the updated WeatherData asset (perlDreamer Consulting, LLC) - File and Image handling via Storage.pm (perlDreamer Consulting, LLC) - Calendar: event details misdirection (perlDreamer Consulting, LLC) + - Calendar asset bug, hourly workflow error (Thanks to Chad Kotil (Global + Research NOC) for debug help with this) 7.3.11 - Added an option for enabling coverage tests to testCodebase.pl. diff --git a/docs/upgrades/upgrade_7.3.11-7.3.12.pl b/docs/upgrades/upgrade_7.3.11-7.3.12.pl index f7ad355a2..e397f0deb 100644 --- a/docs/upgrades/upgrade_7.3.11-7.3.12.pl +++ b/docs/upgrades/upgrade_7.3.11-7.3.12.pl @@ -21,16 +21,24 @@ my $quiet; # this line required my $session = start(); # this line required # upgrade functions go here +deleteUnusedIcalFeeds($session); finish($session); # this line required -##------------------------------------------------- -#sub exampleFunction { -# my $session = shift; -# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet); -# # and here's our code -#} +#------------------------------------------------- +sub deleteUnusedIcalFeeds { + my $session = shift; + print "\tDeleting iCal feeds for Calendar that have already been deleted.\n" unless ($quiet); + my $calendarAssetIds = $session->db->buildArrayRef('select distinct(assetId) from Calendar'); + return unless scalar @{ $calendarAssetIds }; + my $query = sprintf( + "DELETE FROM Calendar_feeds WHERE assetId NOT IN (%s)", + $session->db->quoteAndJoin($calendarAssetIds) + ); + print $query; + $session->db->write($query); +} diff --git a/lib/WebGUI/Asset/Wobject/Calendar.pm b/lib/WebGUI/Asset/Wobject/Calendar.pm index 55d5fa8db..1437c33e7 100644 --- a/lib/WebGUI/Asset/Wobject/Calendar.pm +++ b/lib/WebGUI/Asset/Wobject/Calendar.pm @@ -405,7 +405,7 @@ sub getEditForm { my $form = $self->SUPER::getEditForm; my $i18n = WebGUI::International->new($session,"Asset_Calendar"); - my $tab = $form->addTab("feeds",$i18n->get("feeds")); + my $tab = $form->addTab("feeds",$i18n->get("feeds"), 6); $tab->raw("