Sometimes I cannot remove a group from recipient list of a Mailing. This can happen for instance when I re-use a mailing, but I want to change the group – I can add a new one, but clicking "x" on the old one just triggers "Estimating" label for a while and does not do anything.
Here I cannot remove "Replay" group:
After clicking "Next>", I see the recipient group appearing several times (see attached pictures).
How can I debug this? I wasn't able to reproduce this on demo.civicrm.org.
I'm using CiviCRM 4.6.4 with CiviMail 1.0.
edit: I have done some more tests with CiviCRM 4.6.5, where this bug persists.
As I click through all the "new mailing" fields, there are numerous AJAX calls to https://apps.akcjademokracja.pl/crm/civicrm/ajax/rest
with entity=Mailing
, action=create
API call, with json
similar to:
"{"id":"23","domain_id":"1","header_id":"1","footer_id":"2","reply_id":"8","unsubscribe_id":"5","resubscribe_id":"6","optout_id":"7","mailing_type":"standalone","from_name":"Akcja+Demokracja","from_email":"kontakt@akcjademokracja.pl","url_tracking":"1","forward_replies":"0","auto_responder":"0","open_tracking":"1","override_verp":"1","created_id":"2","created_date":"2015-08-04+13:22:01","scheduled_date":"2015-08-04+13:22:00","approver_id":"2","approval_date":"2015-08-04+13:22:01","is_archived":"0","visibility":"Public+Pages","dedupe_email":"0","email_selection_method":"automatic","is_error":0,"jobs":{},"groups":{"include":[6],"exclude":[],"base":[]},"mailings":{"include":[],"exclude":[]},"name":"placeholder","subject":"placeholder","options":{"force_rollback":1},"api.mailing_job.create":1,"api.MailingRecipients.getcount":{"mailing_id":"$value.id"}}"
as you see, AJAX properly sets "groups":{"include":[6],"exclude":[],"base":[]}
but in the database I see more and more civicrm_mailing_group
entries:
mysql> select * from civicrm_mailing_group where mailing_id = 23 ;
+------+------------+------------+---------------+-----------+-----------+-------------+
| id | mailing_id | group_type | entity_table | entity_id | search_id | search_args |
+------+------------+------------+---------------+-----------+-----------+-------------+
| 5596 | 23 | include | civicrm_group | 6 | NULL | NULL |
| 5597 | 23 | include | civicrm_group | 6 | NULL | NULL |
| 5598 | 23 | include | civicrm_group | 6 | NULL | NULL |
+------+------------+------------+---------------+-----------+-----------+-------------+
3 rows in set (0.00 sec)
Perhaps then, it's a civicrm schema issue – it should force Uniqueness in the table? Or is it rather a backend issue?