diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b4c76cc5c..ecb2e7230 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,10 @@ - fix: Rich Text Editor - Add Asset Tree Link doesn't work with images - fix: Calendar Next / Previous when startTime was involved (Jukka Raimovaara / Axxion Oy) - fix: Creating users with same e-mail address doesn't work. + - fix: Problem with the 7.2.3-7.3.0 upgrade -- Upgrade now gets the last + committed revision of an Event, instead of a random revision. + - fix: Calendars created with the 7.2.3-7.3.0 upgrade now have the same URL as + the Events Calendars they replace. 7.3.9 - fix: SQL Form and big table imports diff --git a/docs/gotcha.txt b/docs/gotcha.txt index f22f2e3ec..7a200a90e 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -7,6 +7,17 @@ upgrading from one version to the next, or even between multiple versions. Be sure to heed the warnings contained herein as they will save you many hours of grief. +7.3.10 +-------------------------------------------------------------------- + * This version fixes a bug in the 7.2.3-7.3.0 upgrade where the + incorrect revision of an Event would be migrated. + + If you have already upgraded, either restore from a backup or + go over your Calendars and ensure that your Event's informations + are accurate. + + If you have not yet upgraded, you do not need to do anything. + 7.3.9 -------------------------------------------------------------------- * This upgrade may appear to freeze when it gets to the "Adding 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 fbc3f5405..18100921c 100644 --- a/docs/upgrades/upgrade_7.2.3-7.3.0.pl +++ b/docs/upgrades/upgrade_7.2.3-7.3.0.pl @@ -235,12 +235,11 @@ sub migrateCalendars { $properties->{defaultDate} = delete $properties->{defaultMonth}; #warn "Found calendar ".$properties->{title}; $properties->{className} = "WebGUI::Asset::Wobject::Calendar"; - + # Add the new asset my $newAsset = $asset->getParent->addChild($properties); #warn "Added Calendar ".$newAsset->get("title")." ".$newAsset->get("className"); - - + # Get this calendar's events and change to new parent my $events = $asset->getLineage(['descendants'], { @@ -251,14 +250,30 @@ sub migrateCalendars { #warn "Got lineage"; - for my $event (@{$events}) - { + for my $event (@{$events}) { #warn "Got event: $event"; # Add a child to the new calendar using the properties # from EventsCalendar_event - my %eventProperties = $session->db->quickHash("select * from asset left join assetData on asset.assetId=assetData.assetId left join EventsCalendar_event on asset.assetId = EventsCalendar_event.assetId where asset.assetId = ?",[$event]); - + my %eventProperties = $session->db->quickHash(" + select + * + from + asset + left join + assetData on asset.assetId=assetData.assetId + left join + EventsCalendar_event on asset.assetId = EventsCalendar_event.assetId and assetData.revisionDate=EventsCalendar_event.revisionDate + where + asset.assetId = ? + and assetData.revisionDate=( + select + max(revisionDate) + from assetData + where assetData.assetId=asset.assetId + and (status='approved' or status='archived') + ) + ",[$event]); delete $eventProperties{assetId}; my ($startDate, $startTime) = split / /, WebGUI::DateTime->new(delete $eventProperties{eventStartDate})->toMysql; @@ -283,9 +298,15 @@ sub migrateCalendars { #warn "Set parents on events"; - # Remove the old asset + # Save the old Calendar's URL so we can fix it + my $fixUrl = $asset->get("url"); + + # Remove the old asset $asset->purge; #warn "Purged old calendar"; + + # Fix the new Calendar's URL + $newAsset->update({ url => $fixUrl }); } }