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

TagList not saving an empty value #1223

Closed
bennothommo opened this issue Oct 8, 2024 · 4 comments · Fixed by #1267 · May be fixed by #1224
Closed

TagList not saving an empty value #1223

bennothommo opened this issue Oct 8, 2024 · 4 comments · Fixed by #1267 · May be fixed by #1224
Assignees
Milestone

Comments

@bennothommo
Copy link
Member

It appears that a TagList widget in relation mode is not saving an empty value, because it no longer sends a POST value when empty.

Replication steps

In the Test plugin:

  • Go to Users, edit either user.
  • Click Tag List Field in the top alternative views box.
  • Empty the Roles field, then try and save.

It does not fail validation, so the form saves, as the last value in the tag list is kept on refresh even though all tags are removed.

@mjauvin
Copy link
Member

mjauvin commented Dec 10, 2024

@bennothommo are you suggesting it's possible to send an empty value in the Post data?

@bennothommo
Copy link
Member Author

@mjauvin most certainly.

@mjauvin
Copy link
Member

mjauvin commented Dec 10, 2024

@mjauvin most certainly.

How do you do that ? (I mean in respect to the TagList formwidget)

@mjauvin mjauvin self-assigned this Dec 10, 2024
@mjauvin mjauvin changed the title Tag list in relation mode not saving an empty value TagList not saving an empty value Dec 10, 2024
@AIC-BV
Copy link
Contributor

AIC-BV commented Dec 19, 2024

relation mode

It doesn't work in update mode either
But its fixed with your PR. Thanks!

LukeTowers pushed a commit that referenced this issue Dec 19, 2024
The TagList formwidget was not working properly in relation mode if the relation was not using a pivot table (e.g. morphMany/hasMany)

All modes did not update the model field or relation when all tags had been cleared.

Fixes #1223
@LukeTowers LukeTowers added this to the 1.2.8 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants