Defect #26667

Filtering time entries after issue's target version doesn't work as expected in some cases

Added by Marius BALTEANU 3 months ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Time tracking
Target version:3.4.3
Resolution:Fixed Affected version:3.4.2

Description

1. Target version select is empty when you add the issue's target version filter
To reproduce:
- Open spent time tab from a project
- Add the Issue's target version filter
- Observe that the dropdown is empty.

If you apply the query, a validation message will appear and the dropdown gets populated.

2. Filtering time entries after multiple target version filters only after the first version.
To reproduce:
- performe de above steps and apply the query
- expand the Target version select to multiselect
- select two versions that have issues with time entries.
- apply the query
- observe that only the time entries related to the issues from first version are returned.

Attached are two patches that fix these 2 issues.

fix_filter_values_for_fixed_version_id.patch Magnifier (1.55 KB) Marius BALTEANU, 2017-08-11 16:29

fix_filter_after_multiple_version_ids.patch Magnifier (1.83 KB) Marius BALTEANU, 2017-08-11 16:30

subproject-dropdown-is-not-working@2x.png (21 KB) Go MAEDA, 2017-08-12 03:21

fix_project_on_time_entry_query_filter.patch Magnifier (494 Bytes) Marius BALTEANU, 2017-08-20 11:47

add_subproject_filter_test_for_time_entries.patch Magnifier (962 Bytes) Marius BALTEANU, 2017-08-20 12:15


Related issues

Related to Redmine - Feature #13558: Add version filter in spent time report Closed
Duplicated by Redmine - Defect #27117: Cannot select versions in Spent time report Closed

Associated revisions

Revision 16997
Added by Jean-Philippe Lang about 1 month ago

Filtering time entries after issue's target version doesn't work as expected in some cases (#26667).

Patch by Marius BALTEANU.

Revision 16999
Added by Jean-Philippe Lang about 1 month ago

Fix filter values for fixed version id (#26667).

Patch by Marius BALTEANU.

Revision 17000
Added by Jean-Philippe Lang about 1 month ago

Fix filter after multiple version ids (#26667).

Patch by Marius BALTEANU.

History

#1 Updated by Go MAEDA 3 months ago

Thank you for finding the probelem. But I think that the root cause of the problem is that TimeEntryQuery#project returns nil instead of the current project. Because of this, subproject dropdown also is not working.

#2 Updated by Go MAEDA 3 months ago

It seems that the drop-down have been broken by r16170.

#3 Updated by Go MAEDA 3 months ago

  • Target version set to 3.4.3

#4 Updated by Marius BALTEANU 3 months ago

Go MAEDA wrote:

Thank you for finding the probelem. But I think that the root cause of the problem is that TimeEntryQuery#project returns nil instead of the current project. Because of this, subproject dropdown also is not working.

Indeed, you're right. Here is a patch that fixes this. It can be applied before or after my previous patches.

fix_filter_values_for_fixed_version_id.patch remains a valid patch because that if is not required, fixed_version_values already checks if the project is defined or not.

#5 Updated by Marius BALTEANU 3 months ago

Added a test also for subproject filter values. It should be applied after my previous patches.

Considering that these issues are quite important, maybe is a good idea to release soon the 3.4.3 version (which has other important fixes).

#6 Updated by Go MAEDA 3 months ago

Marius, thank you for submitting updated patches. Those are works fine for me.

#7 Updated by Go MAEDA 2 months ago

  • Related to Feature #13558: Add version filter in spent time report added

#8 Updated by Maxim KruĊĦina about 1 month ago

  • Duplicated by Defect #27117: Cannot select versions in Spent time report added

#9 Updated by Jean-Philippe Lang about 1 month ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

Committed, thanks.

#10 Updated by Marius BALTEANU about 1 month ago

Jean-Philippe Lang, in this ticket there are 2 more patches that should be committed in my opinion:
1. fix_filter_values_for_fixed_version_id.patch which removes an unnecessary if and adds a test for the first problem reported by me. If you consider that if necessary, we could commit at least the test.
2. fix_filter_after_multiple_version_ids.patch which fixes the second problem reported by me in this ticket.

#11 Updated by Jean-Philippe Lang about 1 month ago

Sorry, both patches are also committed, thanks.

#12 Updated by Marius BALTEANU about 1 month ago

Jean-Philippe Lang wrote:

Sorry, both patches are also committed, thanks.

No problem, thanks for committing these patches.

Also available in: Atom PDF