BUGFIX: Handle revision publications without change snapshots - #2
Draft
rolandschuetz wants to merge 1 commit into
Draft
BUGFIX: Handle revision publications without change snapshots#2rolandschuetz wants to merge 1 commit into
rolandschuetz wants to merge 1 commit into
Conversation
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.
Opening the publication protocol after applying a revision throws a TypeError. The revision factory creates an approved publication with a revision reference but no changes snapshot; the model returns null for its empty BLOB, while the detail controller unconditionally calls an array-only hydrator.
Only hydrate snapshots when present. Keep null distinct from an empty array and retain the existing revision reference and page title so the template can show its revision history message. Pending workspace changes and ordinary completed snapshots keep their existing behavior.
Validation in a local Neos 8 / PHP 8.3 DDEV consumer:
The fix adds a constant-time null check; existing snapshot traversal and revision-node lookup are unchanged. The revision fixture asserts one node lookup, and repeated-read tests verify stored changes are not modified. No cache configuration, queries, writes or external calls were added; no database performance benchmark was run. This is a deterministic component-level reproduction in the consumer environment, not an authenticated browser replay or a full database persistence test.
Run the focused suite from a Neos consumer root:
ddev exec php bin/phpunit --bootstrap Build/BuildEssentials/PhpUnit/UnitTestBootstrap.php --no-configuration --do-not-cache-result Packages/Application/CodeQ.AdvancedPublish/Tests/Unit/Controller/PublicationBackendModuleControllerTest.php