Vote #81889
完了Errors on render details via IssuesHelper.details_to_strings
0%
説明
I have two errors on manual render details via IssuesHelper.details_to_strings
First on render attachments changes in issue:
2: from /usr/src/redmine/app/helpers/issues_helper.rb:494:in block in details_to_strings'show_detail'
1: from /usr/src/redmine/app/helpers/issues_helper.rb:602:in
/usr/src/redmine/app/helpers/application_helper.rb:126:in link_to_attachment': undefined methodattachment_url' for #<#Class:0x0000558479c80de0:0x0000558479c80ae8> (NoMethodError)
Second on render custom field(type=text) changes:
1: from /usr/src/redmine/app/helpers/issues_helper.rb:494:in block in details_to_strings'show_detail': undefined method `diff_journal_url' for #<#Class:0x00005644a8e5db28:0x00005644a8e5ca70> (NoMethodError)
/usr/src/redmine/app/helpers/issues_helper.rb:620:in
Methods attachment_url and diff_journal_url not found in redmine github repo
journals
Both the @attachment_url@ and @diff_journal_url@ methods are dynamically created based on Redmine's URL routing rules to create the full URL to a object. Both of these methods should be available in every rendering context (i.e. within controllers, views and helpers).
To be able to find what went wrong here, it is however required that you show the full stack trace of the error. Please also make sure to run Redmine in production mode by setting @RAILS_ENV=production@ and restart your Redmine applciatiopn server after any change to Redmine's code, any plugin or configuration files on your server.
--------------------------------------------------------------------------------
I use docker image.
issues2chat.rb - script that run via cmd
<pre>
ruby ./scripts/issues2chat.rb
</pre>
issues2chat.rb looks like
<pre>
require "/usr/src/redmine/config/environment"
puts ENV["RAILS_ENV"] // print production
...
helper = Class.new.send(:include, IssuesHelper, ActionView::Helpers::TagHelper, ERB::Util, Redmine::I18n).new
helper.set_language_if_valid('ru')
description_text = helper.details_to_strings(journal.details).join("<br />") + "<br />" + description_text // line 54
...
</pre>
<pre>
5: from ./scripts/issues2chat.rb:54:in `block in <main>'
4: from /usr/src/redmine/app/helpers/issues_helper.rb:480:in `details_to_strings'
3: from /usr/local/bundle/gems/activerecord-5.2.6.3/lib/active_record/relation/delegation.rb:71:in `each'
2: from /usr/local/bundle/gems/activerecord-5.2.6.3/lib/active_record/relation/delegation.rb:71:in `each'
1: from /usr/src/redmine/app/helpers/issues_helper.rb:494:in `block in details_to_strings'
/usr/src/redmine/app/helpers/issues_helper.rb:620:in `show_detail': undefined method `diff_journal_url' for #<#<Class:0x0000562d0f37e640>:0x0000562d0f37e348> (NoMethodError)
</pre>
--------------------------------------------------------------------------------
I think this is a problem with your issues2chat.rb, not with Redmine itself. Please use "forums":https://www.redmine.org/projects/redmine/boards for questions.
--------------------------------------------------------------------------------
I can't find where these methods are defined
--------------------------------------------------------------------------------
Resolved by define_method in script.
<pre>
define_method(:diff_journal_url)...
define_method(:attachment_url))...
</pre>
Can be closed
--------------------------------------------------------------------------------
Thank you for your feedback. Closing.
--------------------------------------------------------------------------------
表示するデータがありません