View filter cannot be removed after set initially #2241
Labels
No Label
dependencies
duplicate
help wanted
invalid
kind/bug
kind/feature
needs reproduction
question
security
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/vikunja#2241
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
When a filter is set for a view, and later on the user tries to remove the filter, it doesn't work. The frontend does send a POST request to the backend containing an empty string for Filter, it is however not changed in the backend.
JSON Request
POST https://try.vikunja.io/api/v1/projects/17/views/309
:JSON Response doesn't contain the filter:
Reload the page, fetching the projects does contain the filter again
GET https://try.vikunja.io/api/v1/projects/17
Vikunja Version
unstable
Browser and version
No response
Can you reproduce the bug on the Vikunja demo site?
Yes
Screenshots
No response
The
filter
is set to an empty string correctly during in the POST, however it doesn't get updated:I don't know enough about Go to propose a fix. Somewhat related is this discussion on SO, but that's to involved for me and there may be way easier ways.
Yeah that's because the nil value of a string is actually an empty string, Vikunja (or rather, xorm) has no way of knowing if the value was not provided or was reset. What we're doing with the other attributes (like tasks) is always requiring all fields to be provided and then telling xorm to update all fields.
Fixed in
89e37b88d9
, please check with the next unstable build