Final piece of #190 — customers upgrading to 7.0 shouldn't hand-edit content.
src/UpdateScripts/MigrateLocationFields.php, same pattern as ConvertConfigToSettings: shouldUpdate() → $this->isUpdatingTo('7.0').
Migration
Iterate entries in Events::setting('collections'), all localizations. Events-owned handles only → nested location group shape from #195:
| Old |
New |
address (string) |
location.name |
non-URL string location |
location.name |
URL string location |
online_url |
link |
online_url |
top-level coordinates |
location.coordinates |
Then remove the old handles. Preserve an existing online_url if already set when migrating link / URL-location.
Never touch a non-string / foreign location. Array-shaped values belong to Prime/Simple (details, etc.) — Prime migrates in transformstudios/prime#834. Log entry IDs and skip.
Ambiguous cases — log and skip (list IDs):
address and a non-URL string location both set (today address wins for LOCATION:)
link and a URL-valued location both set
online_url already set and a conflicting link / URL-location
Tests
TDD. tests/UpdateScripts/MigrateLocationFieldsTest.php:
- each row moves to the nested /
online_url target; old handles removed
- ambiguous cases logged, entry untouched
- array-shaped
location untouched
- top-level
coordinates move under location.coordinates
- multi-site localizations
shouldUpdate() true for 6→7 and 5→7; false within 6.x or 7.x
Docs
Finish 7.0 upgrade notes from #195: what migrates, what skips, back-up-first, computed-value mappings are manual.
Branch
feature/migrate-location-fields off main. Needs #195.
Part of #190.
Final piece of #190 — customers upgrading to 7.0 shouldn't hand-edit content.
src/UpdateScripts/MigrateLocationFields.php, same pattern asConvertConfigToSettings:shouldUpdate()→$this->isUpdatingTo('7.0').Migration
Iterate entries in
Events::setting('collections'), all localizations. Events-owned handles only → nestedlocationgroup shape from #195:address(string)location.namelocationlocation.namelocationonline_urllinkonline_urlcoordinateslocation.coordinatesThen remove the old handles. Preserve an existing
online_urlif already set when migratinglink/ URL-location.Never touch a non-string / foreign
location. Array-shaped values belong to Prime/Simple (details, etc.) — Prime migrates in transformstudios/prime#834. Log entry IDs and skip.Ambiguous cases — log and skip (list IDs):
addressand a non-URL stringlocationboth set (todayaddresswins forLOCATION:)linkand a URL-valuedlocationboth setonline_urlalready set and a conflictinglink/ URL-locationTests
TDD.
tests/UpdateScripts/MigrateLocationFieldsTest.php:online_urltarget; old handles removedlocationuntouchedcoordinatesmove underlocation.coordinatesshouldUpdate()true for 6→7 and 5→7; false within 6.x or 7.xDocs
Finish 7.0 upgrade notes from #195: what migrates, what skips, back-up-first, computed-value mappings are manual.
Branch
feature/migrate-location-fieldsoffmain. Needs #195.Part of #190.