[BUGFIX] Improve type and object version handling when deserializing#131
Merged
[BUGFIX] Improve type and object version handling when deserializing#131
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses issues with type and differing versions of the
SiteLanguageclass when deserializingRecordInstanceIdentifierobjects inReNamespaceDeferredOperationsUpdateWizard.How locale information is stored in
SiteLanguagehas 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 serializedSiteLanguageandLocaleobjects.For example,
SiteLanguage::$localewas a string in TYPO3 <=v12 and aLocaleobject 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
RecordRepresentationobjects. Newer serializations use an array with bothRecordRepresentationand metadata.Resolves: #129