class mine_mail should not be defined conditionally

boombatower - September 26, 2009 - 00:31
Project:Backup and Migrate
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:boombatower
Status:closed
Description

If you have two scheduled backups (files and database) and they both send to e-mail it craps. The first one runs and the second gets a redeclaration of the class error.

If cron is run again then it runs the second one fine. Moving the class outside of the function should fix issue, from my understanding conditionally defining things is not usually a good idea.

#1

boombatower - September 26, 2009 - 21:57
Assigned to:Anonymous» boombatower
Status:active» needs review

This patch makes it work...but I would recommend not defining things conditionally as, to my understanding, it is considered a bad practice...and this shows one of the reasons.

Otherwise great module...I'm running the dev of this and files with the patch applied and things seem to work well.

AttachmentSize
588430-mail-class.patch 4.36 KB

#2

ronan - September 29, 2009 - 14:52

Awesome, thanks for the patch. Truth be told, I don't use this functionality myself so I just ported it straight across from greggle's 1.x patch and haven't paid much attention to it since. I kept meaning to clean that up so thanks again for the patch. I'll get it committed as soon as I have a free minute.

#3

ronan - October 17, 2009 - 19:53
Status:needs review» fixed

Applied.

Thanks again for the patch.

#4

System Message - October 31, 2009 - 20:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.