redmine_mail_reminder icon indicating copy to clipboard operation
redmine_mail_reminder copied to clipboard

Bug when deleting projects

Open royceking opened this issue 9 years ago • 3 comments

FYI when I go into my redmine Administration > Projects and then delete a project. The project's issue reminders don't get destroyed out of the mail_reminders table. The mail reminder run was then complaining about "NoMethodError: undefined method `enabled_module_names' for nil:NilClass", which makes sense since the project doesn't exist. I had to go in and manually delete the rows from the mail_reminders table that were linked to that project_id.

mysql> select * from mail_reminders where project_id=6;
+----+------------+----------+----------+----------------+---------------------+---------------------+---------------------+
| id | project_id | query_id | interval | interval_value | executed_at         | created_at          | updated_at          |
+----+------------+----------+----------+----------------+---------------------+---------------------+---------------------+
| 31 |          6 |        2 | weekly   |              1 | NULL                | 2015-09-29 14:21:44 | 2015-09-29 14:21:44 |
| 67 |          6 |        6 | weekly   |              1 | NULL                | 2015-09-29 15:41:30 | 2015-09-29 15:41:30 |
| 68 |          6 |        5 | weekly   |              1 | NULL                | 2015-09-29 15:41:41 | 2015-09-29 15:41:41 |
| 69 |          6 |        3 | weekly   |              1 | NULL                | 2015-09-29 15:41:51 | 2015-09-29 15:41:51 |
| 70 |          6 |        7 | weekly   |              1 | NULL                | 2015-09-29 15:42:01 | 2015-09-29 15:42:01 |
| 71 |          6 |        4 | daily    |              0 | 2015-10-02 08:30:06 | 2015-09-29 15:42:08 | 2015-10-02 08:30:06 |
+----+------------+----------+----------+----------------+---------------------+---------------------+---------------------+
6 rows in set (0.00 sec)

mysql> delete from mail_reminders where project_id=6;

Is there anything that can be done to make sure all mail_reminders get destroyed when projects are deleted?

royceking avatar Oct 05 '15 16:10 royceking

You are right, the reminder should be deleted in this case.

Androc avatar Oct 07 '15 07:10 Androc

Anything that can be done?

royceking avatar Oct 07 '15 23:10 royceking

I am not good enough to help you on this point.

Androc avatar Oct 08 '15 07:10 Androc