Resolve #3591803: AutoSaveManager::saveEntity() silently clears unresolved conflicts for Page entities"
Description
saveEntity() always recomputed original_hash from the current stored entity hash. When a conflict was active (the stored entity had been externally updated after the auto-save item was created), this advanced original_hash to match the current stored hash, making getUnresolvedConflictForEntity() find no mismatch on the next call. The fix checks, for Page entities only, whether getUnresolvedConflictForEntity() detects an active conflict before persisting original_hash. If a conflict is active, the value already stored in the auto-save item is preserved instead.
Testing instructions
- open a Page in the Canvas editor
- trigger an external save (e.g. via the
drush esave <canvas_page_id> -y) - observe conflict detection after the next auto-save poll or when attempting to publish changes to the Page
- make additional changes to the same Page entity, observe successful
HTTP POSTcall to the/canvas/api/v0/layout/canvas_page/<canvas_page_id> - confirm the conflict banner in the "Unpublished changes" persists after the next auto-save request and the conflict remains detected for the Page entity
Closes #3591803 (closed)