Skip to content

fix(state): do not overwrite previous_data - #8875

Merged
soyuka merged 2 commits into
api-platform:5.0from
soyuka:fix/previous-data-resource
Nov 25, 2026
Merged

soyuka merged 2 commits into
api-platform:5.0from
soyuka:fix/previous-data-resource

Conversation

@soyuka

@soyuka soyuka commented Nov 25, 2026

Copy link
Copy Markdown
Member

Fixes the regression from #8867: ObjectMapperInputProcessor overwrote the previous_data request attribute with the mapped entity, so every later reader (POST_WRITE listeners, AttributesExtractor, PurgeTagProviderInterface on main) got the entity instead of the API resource.

The persist processor still receives the entity through $context['previous_data']. In listeners mode, the entity is carried to WriteListener through a dedicated mapped_previous_data attribute, like mapped_data.

Unblocks main (PurgeTagProviderTest::testMappedResourceUpdateReceivesEntityAndPreviousResource) after merge-up.

The request attribute previous_data holds the API resource read before
the request. Carry the mapped entity through mapped_previous_data for the
listeners-mode WriteListener instead.
@soyuka
soyuka force-pushed the fix/previous-data-resource branch from f015d65 to 3b707e6 Compare November 25, 2026 17:24
@soyuka
soyuka merged commit bfaa178 into api-platform:5.0 Nov 25, 2026
23 of 115 checks passed
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.

1 participant