Defect #14817

Redmine loses filters after deleting a spent time

Added by Thomas Godard over 3 years ago. Updated 2 months ago.

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

0%

Category:Time tracking
Target version:3.3.2
Resolution:Fixed Affected version:2.3.1

Description

When you add filters in the spent time "Details" view, and then delete an entry, the refresh loses the filters you had.

Steps to reproduce:
  • Add a filter
  • Delete a spent time

Expected result:

Refresh with the filter you had

Actual result:

Refresh with the default page

save_time_entries_queries_in_session.patch Magnifier (5.37 KB) Marius BALTEANU, 2016-12-10 23:27


Related issues

Related to Redmine - Defect #13622: "Clear" button in Spent Time Report tab also clears globa... Closed
Duplicated by Redmine - Defect #9016: displayed page after deleting time_entry Closed 2011-08-09

Associated revisions

Revision 16056
Added by Jean-Philippe Lang 3 months ago

Redmine loses filters after deleting a spent time (#14817).

Revision 16104
Added by Jean-Philippe Lang 2 months ago

Fix test in 3.3-stable (#14817).

Revision 16105
Added by Jean-Philippe Lang 2 months ago

Fix test in 3.2-stable (#14817).

History

#1 Updated by Marius BALTEANU 3 months ago

This issue reproduces also on the latest trunk version.

#2 Updated by Marius BALTEANU 3 months ago

I think that this issue is generated by another issue: time spent filters are not stored in the session.

To reproduce:

  1. Go to the spent time tab
  2. Create a filter
  3. Navigate to issues tab
  4. Return to the spent time tab
  5. Observe that the filters are reseted.

#3 Updated by Marius BALTEANU 3 months ago

The below change seems to fix the issue. I'm going to make a patch with tests for this.

diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb
old mode 100644
new mode 100755
index 6c0cd3e..2edf556
--- a/app/controllers/timelog_controller.rb
+++ b/app/controllers/timelog_controller.rb
@@ -281,6 +281,6 @@ private
   end

   def retrieve_time_entry_query
-    retrieve_query(TimeEntryQuery, false)
+    retrieve_query(TimeEntryQuery, true)
   end
 end

#4 Updated by Marius BALTEANU 3 months ago

Attached is a patch that fixes the issue reported initially in this ticket and the issue from note-2. Please let me know if a should open a new ticket for the issue from note-2.

#5 Updated by Go MAEDA 3 months ago

  • Target version set to 3.3.2

Thank you for the patch, it works fine for me and passed all tests.
In addition, the patch also fixes #13622.

Setting target version to 3.3.2.

#6 Updated by Go MAEDA 3 months ago

  • Related to Defect #13622: "Clear" button in Spent Time Report tab also clears global filters added

#7 Updated by Jean-Philippe Lang 3 months ago

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

Marius BALTEANU wrote:

Attached is a patch that fixes the issue reported initially in this ticket and the issue from note-2. Please let me know if a should open a new ticket for the issue from note-2.

Storing the filters in session is a different behaviour, please open another ticket and we'll see if this is desirable, thanks.
I've have the reported issue in r16056 without changing this behaviour.

#8 Updated by Marius BALTEANU 3 months ago

Jean-Philippe Lang wrote:

Marius BALTEANU wrote:

Attached is a patch that fixes the issue reported initially in this ticket and the issue from note-2. Please let me know if a should open a new ticket for the issue from note-2.

Storing the filters in session is a different behaviour, please open another ticket and we'll see if this is desirable, thanks.
I've have the reported issue in r16056 without changing this behaviour.

Here is the new ticket #24581.

#9 Updated by Jean-Philippe Lang 2 months ago

  • Subject changed from Redmine loses filters after deleting a spent time. to Redmine loses filters after deleting a spent time
  • Status changed from Resolved to Closed

#10 Updated by Go MAEDA about 1 month ago

  • Duplicated by Defect #9016: displayed page after deleting time_entry added

Also available in: Atom PDF