Loading...
 
Skip to main content

Group registration in newsletters conflicts with the "Use email as username" feature

Status
Open
Subject
Group registration in newsletters conflicts with the "Use email as username" feature
Version
6.x
7.x
8.x
9.x
Category
  • Conflict of two features (each works well independently)
Feature
Newsletters
User Administration (Registration, Login & Banning)
Submitted by
Marc Laporte
Lastmod by
Marc Laporte
Rating
(0)
Description

To reproduce

  1. Install a fresh Tiki
  2. Create some usernames as usual
  3. Set "Use email as username" feature to yes
  4. Create more users (this time, username will be the email)
  5. Create a newsletter
  6. Subscribe the Registered group to the newsletter
  7. Send a newsletter


The system will crash and be unable to send the newsletter because some users don't have valid emails. If you error reporting is activated, you will get a message like this:

Copy to clipboard
System error. The following error message was returned: Duplicate entry '3-mcradmin-g' for key 'PRIMARY' The query was: INSERT INTO `tiki_newsletter_subscriptions` (`nlId`,`email`,`code`,`valid`,`subscribed`,`isUser`,`included`) VALUES (?,?,?,?,?,?,?) Values: 3 mcradmin 6b78cc21c16e768dd8fbb6b538c6bf78 y 1339700591 g n The built query was likely: INSERT INTO `tiki_newsletter_subscriptions` (`nlId`,`email`,`code`,`valid`,`subscribed`,`isUser`,`included`) VALUES ('3','mcradmin','6b78cc21c16e768dd8fbb6b538c6bf78','y','1339700591','g','n') Things to check: Is your database up and running? Is your database corrupt? Please see how to repair your database Are your database credentials accurate? (username, database name, etc in db/local.php) Did you complete the Tiki Installer? Please see the documentation for more information.
Solution
The system should check if all values are valid emails, and then ignore and report the usernames in the errors.
Workaround

Rename all the users to have proper emails. (Really, you should have done this already for consistency.

Importance
2
Easy to solve?
4
Priority
8
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4244
Created
Thursday 14 June, 2012 21:58:43 UTC
by Marc Laporte
LastModif
Monday 28 October, 2013 07:10:50 UTC


Show PHP error messages