terminal42 / contao-mailusername

MIT License
7 stars 5 forks source link

E-Mail-Adresse nötig trotzt deaktiviertem Login #15

Closed manjarco closed 5 years ago

manjarco commented 5 years ago

Das Mitglied-Formular im BE erwartet eine E-Mail-Adresse obwohl der Login für das Mitglied nicht aktiviert wurde (also auch kein Benutzername gefordert ist).

Fehlermeldung: An exception occurred while executing 'UPDATE tl_member SET username='' WHERE id='57'': SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'username'

Bildschirmfoto 2019-06-10 um 18 11 48
richardhj commented 5 years ago

Mail-Adresse ist ja standardmäßig mandatory?

richardhj commented 5 years ago

In case you disabled mandatory for email, I would recommend to set doNotSaveEmpty to true. Does this fix the issue?

richardhj commented 5 years ago

You can also try to unset($GLOBALS['TL_DCA']['tl_member']['config']['sql']['keys']['email']).

manjarco commented 5 years ago

heimrichhannot/contao-member_plus disabled mandatory for email for me ;)

Both your ideas didn't fix the problem for me. I also tried setting $GLOBALS['TL_DCA']['tl_member']['fields']['username']['eval']['unique'] = false;

But because its a problem with my specific configuration I will find a solution myself. Thanks anyway.

aschempp commented 5 years ago

I think this should be fixed in this bundle. We should only write to the username field if the email value is not empty, and/or if the email field is empty it should set the username to NULL

richardhj commented 5 years ago

Fixed in eab89afa8ae7fc71373e9e38365fd1a8b6f284c2.