Do not append ;adminId to the URL stored for calendar feeds. Add upgrade code to fixing existing, broken feeds. Fixes bug #12164

This commit is contained in:
Colin Kuskie 2011-06-27 14:40:46 -07:00
parent 97ec859653
commit f728b22843
5 changed files with 66 additions and 11 deletions

View file

@ -2,6 +2,7 @@
- fixed #12169: extras uploads symlink export
- Added ability to pass caller assetId to RenderThingMacro
- Allow specific expirations for groups in userImport.pl
- fixed #12164: Calendar feeds with tons of ;adminId=XXXXXX added
7.10.18
- fixed #12138: Version tag gets create by entering and direct leaving

View file

@ -22,6 +22,8 @@ use Getopt::Long;
use WebGUI::Session;
use WebGUI::Storage;
use WebGUI::Asset;
use WebGUI::Asset::Wobject::Calendar;
use Exception::Class;
my $toVersion = '7.10.19';
@ -32,6 +34,7 @@ my $session = start(); # this line required
# upgrade functions go here
addTicketLimitToBadgeGroup( $session );
fixBrokenCalendarFeedUrls ( $session );
finish($session); # this line required
@ -45,6 +48,25 @@ finish($session); # this line required
# print "DONE!\n" unless $quiet;
#}
#----------------------------------------------------------------------------
# Fix calendar feed urls that had adminId attached to them until they blew up
sub fixBrokenCalendarFeedUrls {
my $session = shift;
print "\tChecking all calendar feed URLs for adminId brokenness... " unless $quiet;
my $getCalendar = WebGUI::Asset::Wobject::Calendar->getIsa($session);
CALENDAR: while (1) {
my $calendar = eval { $getCalendar->(); };
next CALENDAR if Exception::Class->caught;
last CALENDAR unless $calendar;
FEED: foreach my $feed (@{ $calendar->getFeeds }) {
$feed->{url} =~ s/adminId=[^;]{22};?//g;
$feed->{url} =~ s/\?$//;
$calendar->setFeed($feed->{feedId}, $feed);
}
}
print "DONE!\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add a ticket limit to badges in a badge group
sub addTicketLimitToBadgeGroup {