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]: Editing users in a slideout and saving with cmd+s triggers an error #15307

Closed
i-just opened this issue Jul 5, 2024 · 2 comments
Closed
Assignees
Labels

Comments

@i-just
Copy link
Contributor

i-just commented Jul 5, 2024

What happened?

Description

Editing users in a slideout and saving with cmd+s triggers an error. Saving via the Save button works as expected.

Steps to reproduce

  1. Open user element in a slideout (either from the users index page or Users field)
  2. Make a change to one of the fields
  3. cmd+s to save
  4. notice the warning appear in the top right corner of the slideout

The error is “Element could not be duplicated because it doesn’t validate.”.
The actual element errors that trigger this are:

  • Username "u1" has already been taken.
  • Email "[email protected]" has already been taken.

Expected behavior

Be able to change and save the user via a slideout using the cmd+s shortcut.

Actual behavior

Not able to save the user via a slideout using the cmd+s shortcut.

Craft CMS version

5.2.5

PHP version

8.1

Operating system and version

No response

Database type and version

mysql 8

Image driver and version

No response

Installed plugins and versions

@brandonkelly
Copy link
Member

Tracked the bug down to this change as part of #14436. Fixed by ensuring that the element editor’s canCreateDrafts setting is true before calling saveDraft() on it (260dce5).

Tested error summaries across multiple tabs and they still seem to be working, but @i-just maybe you have a better idea of what we need to watch out for with that change?

@i-just
Copy link
Contributor Author

i-just commented Jul 15, 2024

I just tested the solution against the problem it was originally for, and all still works as expected (and so does saving users in a slideout via shortcut).

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

2 participants