Skip to content

[6.x] Avoid marking entries dirty when the assets fieldtype reloads - #15518

Merged
jasonvarga merged 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15517-assets-dirty-localization
Sep 28, 2026
Merged

jasonvarga merged 1 commit into
statamic:6.xfrom
lazerg:fix/issue-15517-assets-dirty-localization

Conversation

@lazerg

@lazerg lazerg commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

This pull request fixes an issue where switching between localizations could leave the entry marked as dirty, even though nothing was edited.

When the value of an assets field changes, the fieldtype fetches the asset data from /cp/assets-fieldtype. Once that request comes back, the assets watcher always emitted an update with the asset IDs, even when they matched the current value. If the request took longer than the 500ms window where dirty tracking is paused after a localization switch, the publish container saw that update and flagged the entry as having unsaved changes.

This PR fixes it by only emitting the update when the IDs actually differ from the current value, the same check the value watcher already uses.

Fixes #15517

@jasonvarga
jasonvarga merged commit 86cade2 into statamic:6.x Sep 28, 2026
62 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.

Assets fieldtype marks entry as dirty after switching localization

2 participants