Skip to content

[BUGFIX] Improve type and object version handling when deserializing#131

Merged
mabolek merged 2 commits intomasterfrom
129-upgrade-wizard-type-error
Oct 28, 2025
Merged

[BUGFIX] Improve type and object version handling when deserializing#131
mabolek merged 2 commits intomasterfrom
129-upgrade-wizard-type-error

Conversation

@mabolek
Copy link
Contributor

@mabolek mabolek commented Oct 28, 2025

Addresses issues with type and differing versions of the SiteLanguage class when deserializing RecordInstanceIdentifier objects in ReNamespaceDeferredOperationsUpdateWizard.

How locale information is stored in SiteLanguage has changed between different TYPO3 versions. This fix only allows RecordInstanceIdentifier and RecordRepresentation objects to be deserialized. All other objects are deserialized as __PHP_Incomplete_Class and the object properties can be accessed without reliance on the current TYPO3 version being compatible with the serialized SiteLanguage and Locale objects.

For example, SiteLanguage::$locale was a string in TYPO3 <=v12 and a Locale object in later versions, which led to a "Cannot assign string to property" exception when deserializing older objects.

This bug fix also allows the upgrade wizard to handle deferred operations serialized directly as RecordRepresentation objects. Newer serializations use an array with both RecordRepresentation and metadata.

Resolves: #129

Addresses issues with type and differing versions of the `SiteLanguage` class when deserializing `RecordInstanceIdentifier` objects in `ReNamespaceDeferredOperationsUpdateWizard`.

How locale information is stored in `SiteLanguage` has changed between different TYPO3 versions. This fix only allows RecordInstanceIdentifier and RecordRepresentation objects to be deserialized. All other objects are deserialized as __PHP_Incomplete_Class and the object properties can be accessed without reliance on the current TYPO3 version being compatible with the serialized `SiteLanguage` and `Locale` objects.

For example, `SiteLanguage::$locale` was a string in TYPO3 <=v12 and a `Locale` object in later versions, which led to a "Cannot assign string to property" exception when deserializing older objects.

This bug fix also allows the upgrade wizard to handle deferred operations serialized directly as `RecordRepresentation` objects. Newer serializations use an array with both `RecordRepresentation` and metadata.

Resolves: #129
The `__unserialize()` method of RecordInstanceIdentifier was using real null characters in array keys. Replacing them with "\0" is better and easier to see.
@mabolek mabolek merged commit 54a8938 into master Oct 28, 2025
51 checks passed
@mabolek mabolek deleted the 129-upgrade-wizard-type-error branch October 28, 2025 13:08
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.

[BUG] Upgrade Wizard breaks in TYPO3 v13 with SiteLanguage::$locale TypeError

1 participant