Content
View differences
Updated by Robin Wagner almost 11 years ago
**Preconditions**
- Work package module activated.
- Global query exists.
**Steps to reproduce**
1. Go to global query.
2. Delete global query.
**Actual behavior**
- Error message “Bad request” is displayed and deleting query not possible.
**Expected behavior**
- Query can be deleted.
**Hints for the solution**
- It seems to be a problem with the Angular router. The url that gets called is `api/experimental/projects/null/queries...`. So the `project_id=nil` just gets translated to the project with the id `null`.
- The before filter `find_optional_project` looks for the project of the query (if there is one) and looks if the user has the right to perform the action. This rescues the `ActiveRecord::NotFound` (because no project with ) and renders 404
**Screenshot**

**QA system**
- enterprise-4-0.qa.finn.de
- org-4.0.10
- org-4-1.qa.finn.de
- OpenProject 4.1.0
- Work package module activated.
- Global query exists.
**Steps to reproduce**
1. Go to global query.
2. Delete global query.
**Actual behavior**
- Error message “Bad request” is displayed and deleting query not possible.
**Expected behavior**
- Query can be deleted.
**Hints for the solution**
- It seems to be a problem with the Angular router. The url that gets called is `api/experimental/projects/null/queries...`. So the `project_id=nil` just gets translated to the project with the id `null`.
- The before filter `find_optional_project` looks for the project of the query (if there is one) and looks if the user has the right to perform the action. This rescues the `ActiveRecord::NotFound` (because no project with ) and renders 404
**Screenshot**

**QA system**
- enterprise-4-0.qa.finn.de
- org-4.0.10
- org-4-1.qa.finn.de
- OpenProject 4.1.0