Skip to content

Commit

Permalink
Redmine 3.3 fixes
Browse files Browse the repository at this point in the history
imported from takaosan@9285948
  • Loading branch information
cmrd-senya committed Sep 25, 2018
1 parent 1e766b1 commit e1865ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions app/controllers/boards_watchers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def issues_watchers_bulk

if request.post?
watcher_users=(params['watcher_user_ids'] || []).collect do |w|
u=User.find_by_id(w.to_i)
u=User.find_by(id: w.to_i)
(u && u.active? ? u : nil)
end
watcher_users.compact!
Expand Down Expand Up @@ -92,17 +92,17 @@ def issues_watchers_bulk

def setup_environment
@project=Project.find(params[:project_id])
@board=Board.find_by_id(params[:board_id]) if params[:board_id]
@board=Board.find_by(id: params[:board_id]) if params[:board_id]
render_404 unless @board
@topic=@board.topics.find_by_id(params[:topic_id]) if params[:topic_id]
@topic=@board.topics.find_by(id: params[:topic_id]) if params[:topic_id]
rescue ActiveRecord::RecordNotFound
render_404
end

def setup_environment_issues
@project=nil
unless params[:issues].blank?
@issues=Issue.find_all_by_id(params[:issues])
@issues=Issue.where(id: params[:issues])
@project=@issues[0].project if @issues.size > 0
else
@issues=nil
Expand Down
2 changes: 1 addition & 1 deletion lib/boards_watchers_hooks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def bw_context_menu_link(name, url, options={})
end

if url.is_a?(Hash) && Rails::VERSION::MAJOR >= 3 && Redmine::Utils::relative_url_root != ''
url="#{Redmine::Utils::relative_url_root}#{url_for(url.merge(:only_path => true))}"
url="#{url_for(url.merge(:only_path => true))}"
end
link_to h(name), url, options
end
Expand Down

0 comments on commit e1865ba

Please sign in to comment.