Project

General

Profile

Actions

Defect #17881

closed

Javascript error when displaying a saved query with some defined filters omitted from the available_filters

Added by Holger Just over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

Attached to this issue, there is a fix for an issue that can occur if a users defines a query in another scope than where it is ultimately displayed. If the query define a filter which is not available in the current scope, rendering the filters form will throw a Javascript error resulting in a halt of Javascript execution on the respective page.

In our case at Planio, we had a query that was defined on all projects. The query had a filter of project_id. Now, the project_id is only valid outside of a project. If the query is run inside of a project, the project_id filter will not be added to the available_filters. However, the defined filter is still attempted to be rendered, as the view just loops over all defined filters in the query. This results in a javascript error as during rendering in the browser, the filter can not be added as it is not included in available filters.

The attached patch fixes this issue. It ensures that only those filters are attempted to be rendered that are actually available in the current scope. This fixes the Javascript error.


Files

Actions

Also available in: Atom PDF