redmine anonymous authors.
Added by Leszek Master over 11 years ago
First i've had problems with installing this plugin:
uninitialized constant AnonymousUser
so i commented in the file init.rb line:
unless AnonymousUser.include?(RedmineAnonymousAuthors::AnonymousUserPatch)
AnonymousUser.send :include, RedmineAnonymousAuthors::AnonymousUserPatch
end
and the plugin initialized successfully.
But the problem is no different. I cannot get to New Task subpage (error 500 with error: NoMethodError (undefined method `author_mail=' for #<Issue:0x00000007404ac8>):
[App 47867 stderr] app/controllers/issues_controller.rb:418:in `build_new_issue_from_params')
Can anyone help me get this plugin working :(?
Replies (2)
RE: redmine anonymous authors.
-
Added by Mikael Borg over 11 years ago
Hi,
I'm running redmine 2.4.3, and in order to get this plugin working, I had to make the following changes:
diff --git a/init.rb b/init.rb
index c6552a1..d883906 100644
--- a/init.rb
+++ b/init.rb
@@ -1,4 +1,5 @@
require 'redmine'
+require 'user'
require 'redmine_anonymous_authors'
require 'redmine_anonymous_authors/hooks'
diff --git a/lib/redmine_anonymous_authors/mailer_patch.rb b/lib/redmine_anonymous_authors/mailer_patch.rb
index 80f1357..4642c2e 100644
--- a/lib/redmine_anonymous_authors/mailer_patch.rb
+++ b/lib/redmine_anonymous_authors/mailer_patch.rb
@@ -16,23 +16,23 @@ module RedmineAnonymousAuthors
end
module InstanceMethods
- def issue_add_with_anonymous(issue)
- mail = issue_add_without_anonymous(issue)
+ def issue_add_with_anonymous(issue, to_users, cc_users)
+ mail = issue_add_without_anonymous(issue, to_users, cc_users)
redmine_headers 'Issue-Author' => issue.author.anonymous? ? issue.author.mail : issue.author.login
mail
end
- def issue_edit_with_anonymous(journal)
- mail = issue_edit_without_anonymous(journal)
+ def issue_edit_with_anonymous(journal, to_users, cc_users)
+ mail = issue_edit_without_anonymous(journal, to_users, cc_users)
issue = journal.journalized
redmine_headers 'Issue-Author' => issue.author.anonymous? ? issue.author.mail : issue.author.login
mail
end
- def mail_with_anonymous(headers={})
+ def mail_with_anonymous(headers={}, &block)
if @author && @author.anonymous? && Setting.plugin_redmine_anonymous_authors[:no_self_notified] == '1'
headers[:to].delete(@author.mail) if headers[:to].is_a?(Array)
headers[:cc].delete(@author.mail) if headers[:cc].is_a?(Array)
end
- mail_without_anonymous(headers)
+ mail_without_anonymous(headers, &block)
end
def create_mail_with_anonymous
if @author && @author.anonymous? && Setting.plugin_redmine_anonymous_authors[:no_self_notified] == '1'
The diff is against git://git.academ.org/redmine_anonymous_authors.git, commit 6d6c52a59f88800d51a554350d5dbab8ce1cc0f1.
Hope this helps.
RE: redmine anonymous authors.
-
Added by Leszek Master over 11 years ago
Worked like a charm !
Thank you very much. :)