Ilogeek / redmine_issue_dynamic_edit

Allows users to dynamically update (AJAX) issue's attributes from issue details page without any refresh (JIRA like)
http://www.redmine.org/plugins/redmine_issue_dynamic_edit
MIT License
137 stars 55 forks source link

edit error, please help to check it. #9

Closed archonwang closed 7 years ago

archonwang commented 7 years ago

@Ilogeek ,

edit error, please help to check it.

logs

An ActionView::Template::Error occurred in issues#show:

  undefined method `<<' for nil:NilClass
  plugins/redmine_issue_dynamic_edit/lib/details_issue_hooks.rb:129:in `view_issues_show_details_bottom'

-------------------------------
Request:
-------------------------------

* URL : http://192.168.1.41/issues/10329
  * HTTP Method: GET
  * IP address : 192.168.60.249
  * Parameters : {"controller"=>"issues", "action"=>"show", "id"=>"10329"}
  * Timestamp  : 2017-08-28 07:39:11 UTC
  * Server : jira
  * Rails root : /opt/redmine-3.3
  * Process: 17144

-------------------------------
Session:
-------------------------------

  * session id: nil
  * data: {}

-------------------------------
Environment:
-------------------------------

  * GATEWAY_INTERFACE                              : CGI/1.2
  * HTTP_ACCEPT                                    : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  * HTTP_ACCEPT_ENCODING                           : gzip, deflate, sdch
  * HTTP_ACCEPT_LANGUAGE                           : zh-CN,zh;q=0.8
  * HTTP_CONNECTION                                : keep-alive
  * HTTP_HOST                                      : 192.168.1.41
  * HTTP_UPGRADE_INSECURE_REQUESTS                 : 1
  * HTTP_USER_AGENT                                : Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
  * HTTP_VERSION                                   : HTTP/1.1
  * ORIGINAL_FULLPATH                              : /issues/10329
  * ORIGINAL_SCRIPT_NAME                           :
  * PATH_INFO                                      : /issues/10329
  * QUERY_STRING                                   :
  * REMOTE_ADDR                                    : 192.168.60.249
  * REQUEST_METHOD                                 : GET
  * REQUEST_PATH                                   : /issues/10329
  * REQUEST_URI                                    : /issues/10329
  * ROUTES_44094180_SCRIPT_NAME                    :
  * SCRIPT_NAME                                    :
  * SERVER_NAME                                    : 192.168.1.41
  * SERVER_PORT                                    : 80
  * SERVER_PROTOCOL                                : HTTP/1.1
  * SERVER_SOFTWARE                                : thin 1.7.0 codename Dunder Mifflin
  * action_controller.instance                     : #<IssuesController:0x007fde3d9f1f50>
  * action_dispatch.backtrace_cleaner              : #<Rails::BacktraceCleaner:0x00000001abff08>
  * action_dispatch.cookies                        : #<ActionDispatch::Cookies::CookieJar:0x007fde3dbaa220>
  * action_dispatch.cookies_digest                 :
  * action_dispatch.cookies_serializer             :
  * action_dispatch.encrypted_cookie_salt          : encrypted cookie
  * action_dispatch.encrypted_signed_cookie_salt   : signed encrypted cookie
  * action_dispatch.http_auth_salt                 : http authentication
  * action_dispatch.key_generator                  : #<ActiveSupport::CachingKeyGenerator:0x0000000a66e928>
  * action_dispatch.logger                         : #<ActiveSupport::Logger:0x000000053e73a8>
  * action_dispatch.parameter_filter               : [:password]
  * action_dispatch.redirect_filter                : []
  * action_dispatch.remote_ip                      : 192.168.60.249
  * action_dispatch.request.content_type           :
  * action_dispatch.request.formats                : [#<Mime::Type:0x00000004171f70 @synonyms=["application/xhtml+xml"], @symbol=:html, @string="text/html", @hash=1358787599226879765>]
  * action_dispatch.request.parameters             : {"controller"=>"issues", "action"=>"show", "id"=>"10329"}
  * action_dispatch.request.path_parameters        : {:controller=>"issues", :action=>"show", :id=>"10329"}
  * action_dispatch.request.query_parameters       : {}
  * action_dispatch.request.request_parameters     : {}
  * action_dispatch.request.unsigned_session_cookie: {}
  * action_dispatch.request_id                     : c2a109bc-4317-4a40-a143-23418bb3df89
  * action_dispatch.routes                         : #<ActionDispatch::Routing::RouteSet:0x0000000541a5c8>
  * action_dispatch.secret_key_base                : 59dda17a42803617f96151518b9aeecb94e132c6f140123f1982e1c8ae15d0103ffa854c4d8b0019
  * action_dispatch.secret_token                   :
  * action_dispatch.show_detailed_exceptions       : false
  * action_dispatch.show_exceptions                : true
  * action_dispatch.signed_cookie_salt             : signed cookie
  * async.callback                                 : #<Method: Thin::Connection#post_process>
  * async.close                                    : #<EventMachine::DefaultDeferrable:0x007fde3dab08b0>
  * rack.errors                                    : #<IO:0x00000000c25588>
  * rack.input                                     : #<StringIO:0x007fde3dab13c8>
  * rack.multiprocess                              : false
  * rack.multithread                               : true
  * rack.request.cookie_hash                       : {}
  * rack.request.query_hash                        : {}
  * rack.request.query_string                      :
  * rack.run_once                                  : false
  * rack.session                                   : #<ActionDispatch::Request::Session:0x007fde3da3d4f0>
  * rack.session.options                           : #<ActionDispatch::Request::Session::Options:0x007fde3da3d4a0>
  * rack.url_scheme                                : http
  * rack.version                                   : [1, 0]

-------------------------------
Backtrace:
-------------------------------

  plugins/redmine_issue_dynamic_edit/lib/details_issue_hooks.rb:129:in `view_issues_show_details_bottom'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:96:in `call_hook'
  plugins/redmine_workflow_hidden_fields/app/views/issues/show.html.erb:122:in `_443f56b6486a06f248042bb6cccebbb3'
  plugins/redmine_spent_time_in_issue_description/lib/issues_controller_patch.rb:36:in `block (2 levels) in show_with_plugin'
  plugins/redmine_spent_time_in_issue_description/lib/issues_controller_patch.rb:33:in `show_with_plugin'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
Ilogeek commented 7 years ago

Hello @archonwang

This part is strange :

undefined method <<' for nil:NilClass plugins/redmine_issue_dynamic_edit/lib/details_issue_hooks.rb:129:in view_issues_show_details_bottom'

Did you modify redmine_issue_dynamic_edit/lib/details_issue_hooks.rb file ? What have you got at line 129 ? It looks like there's a problem with this line (you can compare with the file from the repo)

archonwang commented 7 years ago

@Ilogeek , I have not modified the file. and I found it seems that when I use anoyous user to view the issue details occured the error. I used redmine 3.3.4 with mysql.

Ilogeek commented 7 years ago

Hello @archonwang

I updated the code. The problem was that the variable o was only created if the user was authenticated. I moved the declaration and now the problem may be fixed.

If you don't want to update to v0.4.0 and keep the one you have, you just have to edit redmine_issue_dynamic_edit/lib/details_issue_hooks.rb file and add o = '' at line 20 (don't forget to delete line 26 at the same time)

archonwang commented 7 years ago

@Ilogeek , Thanks. I will test it later on my environment.

~~ Good! it works. Thanks.