Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicating a channel leads to an error #15

Closed
fritzmg opened this issue Mar 16, 2018 · 13 comments
Closed

duplicating a channel leads to an error #15

fritzmg opened this issue Mar 16, 2018 · 13 comments
Assignees
Labels
Milestone

Comments

@fritzmg
Copy link
Contributor

fritzmg commented Mar 16, 2018

Reproduction:

  1. Log in to https://demo.contao.org/contao.
  2. Go to Newsletters and edit the recipients of Newsletter - Demo.
  3. Add example1@example.org and example2@example.org.
  4. Go back to Newsletters and copy the Newsletter - Demo channel.

You will see the following error:

An exception occurred while executing 'INSERT INTO tl_newsletter_recipients (`pid`, `tstamp`, `email`, `active`, `addedOn`, `confirmed`, `ip`, `token`) VALUES ('7', 1521189960, '', '', '', '', '', '')': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '7-' for key 'pid_email'

This happens because during the duplication the email address for each duplicated recipient is removed.

@leofeyer
Copy link
Member

Does this affect Contao 4.4 as well?

@fritzmg
Copy link
Contributor Author

fritzmg commented Mar 16, 2018

Yes, Contao 4.4.16 and 4.5.6 are affected.

@leofeyer leofeyer added the bug label Mar 16, 2018
@leofeyer leofeyer added this to the 4.4.17 milestone Mar 16, 2018
@leofeyer
Copy link
Member

Does it even make sense to duplicate newsletter recipients when a channel is duplicated?

@rflx
Copy link

rflx commented Mar 19, 2018

@leofeyer you mean to only duplicate the newsletter channel settings without its recipients? I think it makes sense to duplicate the recipients, otherwise you'll need to export/import the recipients from the main channel if you want to copy them to a new one.

@leofeyer
Copy link
Member

I guess you are right, although I'm not sure if exporting and importing (a.k.a. subscribing a recipient to a new channel without double opt-in) is still allowed under the regulations of the GDPR. But we will know soon. 😄

@leofeyer
Copy link
Member

leofeyer commented Mar 29, 2018

The issue is caused by the 'doNotCopy'=>true flag which we have added in a215141. If the flag is removed from the email and active fields, the recipients and their activation status are copied.

The flag is not set in Contao 3.5, therefore I think we can remove it in Contao 4.4 again. However, the activation status is not copied neither in Contao 3.5 nor in Contao 4, which means all duplicated recipients are disabled by default. This is not what we want, is it?

@contao/developers /cc

@aschempp
Copy link
Member

aschempp commented Apr 3, 2018

I don't understand. How does it make sense to duplicate a recipient but not copy it's email address???

@frontendschlampe
Copy link

I think, it's inadmissible to copy a channel with it's mail addresses because of privacy. If a user subscribed for a special channel with special information, than he want to have only these information and not any other one ... so we have to deactivate the copy function for channels.

@rflx
Copy link

rflx commented Apr 3, 2018

@frontendschlampe there is always a way to duplicate them if you want to. I think Contao should give the admin the possibility to duplicate them (not for abuse purposes). Privacy is very important but i think in this case its not an issue of Contao.

@frontendschlampe
Copy link

Yes, but we also add the 'doNotCopy'=>true for a single recipient ... if anybody find another way to copy them, they should do, but we should not support them.

@aschempp
Copy link
Member

aschempp commented Apr 3, 2018

If a user subscribed for a special channel with special information, than he want to have only these information and not any other one

They don't necessary sign up for a special channel, they might sign up for your news. Noone knows people organize their newsletters and channels. Imho they should not be marked as double-opt-in but simply as manually added, but they sure should be copied.

@aschempp
Copy link
Member

aschempp commented Apr 3, 2018

Also, not copying the email does not do what you describe. It does copy all recipient records but empties the email field. Which means you get 1000 subscribers without email. Certainly not useful.

@leofeyer
Copy link
Member

leofeyer commented Apr 3, 2018

Fixed in 04ad925.

@leofeyer leofeyer closed this as completed Apr 3, 2018
@leofeyer leofeyer modified the milestones: 4.4.17, 4.4 May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants