Project

General

Profile

Actions

Defect #14965

closed

QueryColumn::sql_for_field assumes that operators "issue is opened/closed" deal with field named 'status_id' only - not extendable

Added by Egor Suvorov over 10 years ago. Updated over 5 years ago.

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

0%

Estimated time:
Resolution:
Invalid
Affected version:

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).

Actions #1

Updated by Egor Suvorov over 10 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.

Actions #2

Updated by Marius BÄ‚LTEANU over 5 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.

Actions

Also available in: Atom PDF