Unable to turn off "For all projects" flag of custom queries
|Target version:||Candidate for next major release|
The "For all projects" flag of custom queries cannot be disabled if once enabled.Steps to reproduce:
- Create a query with "For all projects" flag enabled.
- Edit the newly created query.
- Uncheck "For all projects" checkbox and save the query.
- Edit the query again.
- "For all projects" checkbox is expected to be cleared, but it is actually checked.
#1 Updated by Go MAEDA over 4 years ago
It is because queries with "For all projects" enabled don't have the information of its belonging project.
IssueQuery.project indicates the query's belonging project, but the value is nil for queries "for all projects" (nil means that the queriy is "For all projects"). Therefore, Redmine cannot determine the value to be set for the "project_id" attribute when "For all projects" is disabled, and project_id will remain nil even after saving the query. As a result, the "For all projects" never be turned off.