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

  1. Page layout builder, profile with the Save status island, display published.
  2. Drag a component from the library onto the empty canvas.
  3. 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.

Command icon 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

hydra created an issue. See original summary.

hydra’s picture

Status: Active » Needs review
mogtofu33’s picture

Assigned: Unassigned » mogtofu33

  • mogtofu33 committed b5bf6340 on 1.0.x authored by hydra
    fix: #3635809 Save status pip stays on "Published" after an edit
    
    By:...
mogtofu33’s picture

Assigned: mogtofu33 » Unassigned
Status: Needs review » Fixed

Thanks for the work.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

hydra’s picture

With pleasure! Thx for the very quick reactions :D Haven't even released the patches in my project, thats great! You guys Rock!