プロジェクト

全般

プロフィール

Vote #74027

完了

Error generated on 'search for watchers to add' after clicking add without selected users

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
82
issue_org_id:
14298
author_id:
11787
assigned_to_id:
1
comments:
3
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

On the New Issue page, after clicking Add on Search for watchers to add without selecting any user, generates the following error on the logs:

An ActionView::Template::Error occurred in watchers#append:

undefined method `each' for nil:NilClass
app/views/watchers/append.js.erb:1:in `_app_views_watchers_append_js_erb__1816769395046035616_62007020'
  actionpack (3.2.13) lib/action_view/template.rb:145:in `block in render'
  activesupport (3.2.13) lib/active_support/notifications.rb:125:in `instrument'
  actionpack (3.2.13) lib/action_view/template.rb:143:in `render'
  actionpack (3.2.13) lib/action_view/renderer/template_renderer.rb:47:in `block (2 levels) in render_template'
  actionpack (3.2.13) lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
(...)

A possible fix is to change WatchersController#append to render nothing when no user is selected:


  def append
    if params[:watcher].is_a?(Hash)
      user_ids = params[:watcher][:user_ids] || [params[:watcher][:user_id]]
      @users = User.active.find_all_by_id(user_ids)
    else
      render :nothing => true
    end
  end
My redmine environment is: ---
Environment:
  Redmine version                          2.3.1.devel
  Ruby version                             1.9.3 (x86_64-linux)
  Rails version                            3.2.13
  Environment                              production
  Database adapter                         PostgreSQL
SCM:
  Subversion                               1.7.5
  Mercurial                                2.6.1
  Cvs                                      1.12.13
  Bazaar                                   2.6
  Git                                      1.7.10.4
  Filesystem                               

journals

Fixed in r12985.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------


related_issues

duplicates,Closed,16379,Undefined method `each' for nil:NilClass on search for watchers to add

Admin Redmine さんが3年以上前に更新

  • カテゴリIssues_2 にセット
  • 対象バージョン2.5.1_82 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0