due_date_reminder icon indicating copy to clipboard operation
due_date_reminder copied to clipboard

Error running rake: `with_synched_deliveries' in Redmine 1.3

Open Bodge-IT opened this issue 12 years ago • 12 comments

I get the following in my log for the chron job: rake aborted! undefined method `with_synched_deliveries' for Mailer:Class

Tasks: TOP => redmine:reminder_plugin:send_notifications (See full trace by running task with --trace)

Any suggestion?

UPDATE: alnmuniz commented: hi, the file do patch is mailer.rb, here it is located at "redmine install dir"\app\models. All you have to do is copy the with_synched_deliveries method body from the latest version (get it here https://github.com/redmine/redmine/blob/master/app/models/mailer.rb) and paste it into your current mailer.rb version. where exactaly? well, I put it right after the with_deliveries method, but I guess it might work anywhere within the class body. :)

Bodge-IT avatar Jun 23 '12 08:06 Bodge-IT

What a version of Redmine do you use? How did you obtain the plugin from github and what is the version?

f0y avatar Jun 23 '12 08:06 f0y

Hi Oleg, Got the plug in by download from github, version is 1.3.2 but hoping to move to 1.4 soon. Not sure what version plug in, latest version I guess. Thanks for speedy response, Gary On Jun 23, 2012 9:47 AM, "Oleg Kandaurov" < [email protected]> wrote:

What version of Redmine do you use? How did you obtain the plugin from github and what is version?


Reply to this email directly or view it on GitHub: https://github.com/f0y/due_date_reminder/issues/4#issuecomment-6523560

Bodge-IT avatar Jun 23 '12 17:06 Bodge-IT

Please, check the plugin version. I guess that you are using wrong version. The latest version of plugin is 0.3.1 and it is for redmine 2.0. The plugin version can be seen on the plugins page. In order to obtain the plugin for redmine 1.3 go to the plugin directory and perform command git checkout v0.1.1 Let me know results.

f0y avatar Jun 23 '12 18:06 f0y

Hi, plugin version was already 0.1.1. So not using wrong version for my version of Redmine.

Any other suggestion?

Bodge-IT avatar Jun 26 '12 07:06 Bodge-IT

Well I should check it. It will take some time but I think I'll do it in the nearest weekend.

f0y avatar Jun 29 '12 10:06 f0y

hi there! I was having the same problem and the cause is that there is no method called 'with_synched_deliveries' in Mailer.rb in version 1.3. I just added this method to Mailer.rb and it worked. Of course this is a workaround, but it should work while I don't upgrade my Redmine version. The method code is:

Sends emails synchronously in the given block

def self.with_synched_deliveries(&block) saved_method = ActionMailer::Base.delivery_method if m = saved_method.to_s.match(%r{^async_(.+)$}) ActionMailer::Base.delivery_method = m[1].to_sym end yield ensure ActionMailer::Base.delivery_method = saved_method end

alnmuniz avatar Jul 12 '12 10:07 alnmuniz

I see. Do you use the latest version of 1.3.x branch?

f0y avatar Jul 12 '12 11:07 f0y

I'm not sure because I use the bitnami.org redmine stack version 1.3.2-1. I don't know if that is the latest version of 1.3.x branch.

alnmuniz avatar Jul 12 '12 11:07 alnmuniz

Sorry, its my fault. I forgot that this changes have been added in Redmine version 1.4 not 1.3. You solution is absolutely correct. I should create patch for version 1.3 and update readme file accordingly.

f0y avatar Jul 12 '12 11:07 f0y

I have the same problem with RedMine 1.3.0. Can you please explain the fix in a more detailed way (which file exactly to patch and where to insert the patch. Thanks.

ghost avatar Jul 17 '12 01:07 ghost

hi, the file do patch is mailer.rb, here it is located at "redmine install dir"\app\models. All you have to do is copy the with_synched_deliveries method body from the latest version (get it here https://github.com/redmine/redmine/blob/master/app/models/mailer.rb) and paste it into your current mailer.rb version. where exactaly? well, I put it right after the with_deliveries method, but I guess it might work anywhere within the class body. :)

alnmuniz avatar Jul 17 '12 15:07 alnmuniz

Thank you alnmuniz for your explanation. I did what you said and it works now perfectly.

ghost avatar Jul 17 '12 16:07 ghost