jijeshmohan / redmine_track_control

Redmine Plugin to control issue creation with specific tracker
http://jijeshmohan.wordpress.com/2011/12/24/redmine-tracker-control-plugin-released
Other
18 stars 17 forks source link

Fixed wrong permission labels for trackers in the "Roles and permissions" edit page. #26

Closed jgonzalezdr closed 9 years ago

jijeshmohan commented 9 years ago

Hi, Could you please check this again with latest plugin version(1.0.9) ? I am able to see the labels properly ( name instead of id)

jgonzalezdr commented 9 years ago

It does not work every time because when you patch the roles controller, you only patch the actions "show" and "permissions", but you don't patch other actions like "edit", so when you try to edit the permissions given to a role (without executing the actions "show" or "permissions" before), then the proper "translations" are not inserted.

This is an screenshot when I try to edit the permissions of a role just after having restarted redmine: image

This is an screenshot when showing the permissions summary ("permissions" action), which worked fine: image

Basically my solution fixes this by removing the individual patches to each action (that you implemented using the alias_method_chain methods) and replacing them with a "before_filter", which is nicer because it makes the "translations" getting inserted before all actions (making the plugin more maintainable and ready for future changes in the roles controller) in a simpler way.

jgonzalezdr commented 9 years ago

BTW, I merged your latest changes into my tree to make it easier for you if you decide to incorporate this pull request.

jgonzalezdr commented 9 years ago

And fixed the last merge errors...

jijeshmohan commented 9 years ago

Thanks @jgonzalezdr , I have merged the pull request