Generated with the help of an LLM.
Problem/Motivation
save_status.js isOwnMutation() counts a request as an edit when its path is exactly /api/display-builder/{instance} or starts with /api/display-builder/{instance}/. Two kinds of paths fail that check:
- a query string: a drop on the root posts to
/api/display-builder/{instance}?from=builder - a path prefix or base path:
/de/api/…,/subdir/api/…,/preview/{site}/api/…
The pip then stays on "Published" while the display has a draft.
Steps to reproduce
- Page layout builder, profile with the Save status island, display published.
- Drag a component from the library onto the empty canvas.
- The pip keeps
db-save-status--published.
Seen on 1.0.0-beta9; save_status.js is unchanged on 1.0.x. save_status.spec.ts checks this drop and expects --saved, so I'm not sure why it passes there.
Proposed resolution
Compare the pathname without the query, against drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + 'api/display-builder/' + instance id.
Remaining tasks
MR.
User interface changes
None.
API changes
None.
Data model changes
None.
Issue fork display_builder-3635809
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
hydra commentedComment #4
mogtofu33 commentedComment #6
mogtofu33 commentedThanks for the work.
Comment #8
hydra commentedWith pleasure! Thx for the very quick reactions :D Haven't even released the patches in my project, thats great! You guys Rock!