Skip to content

[6.x] Only change date for localizations with an explicit date set#14362

Merged
jasonvarga merged 2 commits into6.xfrom
migrate-to-utc-localizations
Mar 26, 2026
Merged

[6.x] Only change date for localizations with an explicit date set#14362
jasonvarga merged 2 commits into6.xfrom
migrate-to-utc-localizations

Conversation

@duncanmcclean
Copy link
Copy Markdown
Member

This pull request fixes an issue where the migrate-dates-to-utc command would result in incorrect dates for localized entries in multisite setups.

This was happening because when a localized entry inherits its date from an origin entry, calling $item->date() returns the origin's date. If the origin was processed first, this date would already be in UTC, but the command would treat it as being in the current timezone and convert it again, causing double-conversion.

This PR fixes it by checking hasExplicitDate() before migrating entry dates. Entries that don't have an explicit date (they inherit from the origin) are now skipped, since the origin will be migrated separately and the inheritance will continue to work correctly.

Fixes #14343

@jasonvarga jasonvarga merged commit d6a494d into 6.x Mar 26, 2026
17 checks passed
@jasonvarga jasonvarga deleted the migrate-to-utc-localizations branch March 26, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timezone migration command results in wrong dates

2 participants