Project

General

Profile

Actions

Defect #32959

closed

Fix selected user on log time edit page when user has permissions to log time for another user

Added by about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Time tracking
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

when you're editing a existing timelog entry and have the rights to adjust the user ( or log on behalf of another user ), the current value will not be selected in the drop down due to this line:

https://www.redmine.org/projects/redmine/repository/revisions/19326/entry/branches/4.1-stable/app/helpers/application_helper.rb#L578

the fix is quite simple, just drop the .to_s

      selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id == selected

and its working.

diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index b40f42ecc..e13825082 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -575,7 +575,7 @@ module ApplicationHelper
     end
     groups = +''
     collection.sort.each do |element|
-      selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id == selected
+      selected_attribute = ' selected="selected"' if option_value_selected?(element, selected) || element.id.to_s == selected
       (element.is_a?(Group) ? groups : s) << %(<option value="#{element.id}"#{selected_attribute}>#{h element.name}</option>)
     end
     unless groups.empty?


Files


Related issues

Related to Redmine - Feature #3848: Permission to log time for another userClosedJean-Philippe Lang2009-09-11

Actions
Actions

Also available in: Atom PDF