Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.x]: Clicking "Save" in element slideouts doesn't save the element if the initial slideout auto-save hasn't triggered #15938

Closed
mmikkel opened this issue Oct 22, 2024 · 2 comments
Assignees
Labels

Comments

@mmikkel
Copy link
Contributor

mmikkel commented Oct 22, 2024

What happened?

Description

If the "Save" button in an element slideout is clicked after making an initial content change, before the slideout auto-save has had a chance to trigger, the slideout will close and Craft will create a provisional draft behind the scenes, i.e. leaving the element in an "Edited" state, instead of actually saving it.

This behavior can make quick-editing elements via slideouts a chore, as authors needs to remember to wait for the auto-save to trigger after making their edit. If not, they will have to re-open the "Edited" element after the slideout closes, and then click "Save" again to actually save their changes.

I'm not able to reproduce this behavior when using the Cmd+S shortcut to save changes in slideouts, it specifically only happens when clicking the Save button.

CleanShot.2024-10-22.at.12.02.42.mp4

Steps to reproduce

  1. Edit an element in a slideout. Make sure the element has no "unsaved changes" from before.
  2. Make a change to a field, and then quickly click the slideout "Save" button, before the auto-save has had a chance to trigger.
  3. Observe that after the slideout closes, the element chip or card becomes tagged with "Edited", as Craft has created a provisional draft instead of actually saving the element.

Expected behavior

Clicking the "Save" button in an element slideout should always save the element.

Actual behavior

Clicking the "Save" button does not save the element if the slideout hasn't had time to create a provisional draft before the button is clicked.

Craft CMS version

5.4.8

PHP version

8.2.22

Operating system and version

macOS 14.6.1 (DDEV v1.23.4)

Database type and version

MySQL 8.0.36

Image driver and version

No response

Installed plugins and versions

None

@mmikkel mmikkel added the bug label Oct 22, 2024
@mmikkel mmikkel changed the title [5.x]: Clicking "Save" in element slideouts doesn't save the element if the slideout auto-save hasn't run [5.x]: Clicking "Save" in element slideouts doesn't save the element if the initial slideout auto-save hasn't triggered Oct 22, 2024
@i-just i-just self-assigned this Oct 22, 2024
@i-just
Copy link
Contributor

i-just commented Oct 22, 2024

Hi, thanks for reporting!

It looks like the changes are saved, but then a provisional draft is still created with content that’s already been saved. I raised a PR for this.

@brandonkelly
Copy link
Member

Craft 5.4.9 is out with that fix. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants