Defect #14965
closedQueryColumn::sql_for_field assumes that operators "issue is opened/closed" deal with field named 'status_id' only - not extendable
0%
Description
While trying to add some custom filters I found out that even if you call sql_for_field with specific table and field name, it still uses #{queries_table_name}.status_id as field in generated WHERE statement. You can see the problem in /app/models/query.rb:687
I'd like to change it to #{db_table}.#{db_field} (this seems more extendable and corresponds with what is written in another operators' code).
       Updated by Egor Suvorov about 12 years ago
      Updated by Egor Suvorov about 12 years ago
      
    
    Forget to mention: usage of #{queries_table_name} also looks very strange, all other operators use #{db_table} instead. That was the main problem for me - I had to select all TimeEntry which are related to closed issues, and #{queries_table_name} was TimeEntries instead of Issues.
       Updated by Marius BĂLTEANU almost 7 years ago
      Updated by Marius BĂLTEANU almost 7 years ago
      
    
    - Status changed from New to Closed
- Resolution set to Invalid
Query model has been refactorized in the recent Redmine versions and there is no such limitation.