Issue global custom fields should be available in filters only for their trackers
Although it is possible to select trackers in which custom fields with for all projects flag set present, those fields available as the filters in the query dialog. Also they are included in the Query.available_columns enumeration.
For example, you have custom field named Type which is required for all projects but only for tracker Bugs. Then you have project Details which does not have tracker Bugs, but custom field type available as filter in this project anyway.
In my code i used following workaround:
def column_exists_for_project?(column, project)
return true unless (column.is_a?(QueryCustomFieldColumn) && project != nil)
project.trackers.each do |t|
t.custom_fields.each do |c|
return true unless c.id != column.custom_field.id
I am using r3285 of Redmine