I installed this module, enabled it and through admin I added a second user with the same email as a previously added user. That worked fine. But then when I added a third user with the same email address, I got this error: "The e-mail address sharedemail_malindamm@gmail.com is already registered. Have you forgotten your password?" I am trying to create dummy users to test out all my different roles and want them all to have the same email address.

Also when I look at the 'My Account' page for the second user, the email is listed as: "sharedemail_malindamm@gmail.com" even though I thought this module was supposed to keep the original that I entered, which was: "malindamm@gmail.com"

Did I miss a setting somewhere?

Lastly, do you know if this module breaks any others? And what happens if I disable it later when the site goes live, will my dummy accounts still work?

CommentFileSizeAuthor
#3 sharedmail.patch1.98 KBmuhleder

Comments

ao5357’s picture

This happened to me as well.

ao5357’s picture

Component: User interface » Code
Priority: Normal » Critical

I don't understand why the 6.x branch was ever versioned for production. It's definitely untested beta, not even a release candidate. If this module isn't being maintained and the 6.x version is going to stay that way, at the very least you could push the (identical) 6.x dev version to 6.x-2.x-beta1 so people know that it isn't ready for production sites.

muhleder’s picture

Status: Active » Needs review
StatusFileSize
new1.98 KB

The 6 branch used to work. It looks like something has changed in the user process to stop it working. Anyway, here's a patch that should fix it.

What happened was, the $user->mail variable has the 'sharedemail_' string added during validation, so that it doesn't clash with the existing email addresses. It was then supposed to have that removed before the user object was inserted into the database. That last part is now not being called.

This patch now also checks for the 'sharedemail_' string during user load, and if so makes a direct update to the database, and changes the $user->mail variable in memory so any later use of it should be correct.

The module only has about 25 lines of active code, so if you really need a fix for a bug quickly you should be able to post a bounty to get it done for a reasonable fee. Good, cheap or quick. Choose two.

aufumy’s picture

Status: Needs review » Fixed

Thanks muhleder for the patch, malindamm and ao5357 for status updates.

Patch committed, however using 'insert' instead of 'load' in hook_user(), also changed if statement to switch case.

ao5357’s picture

Sorry to be so harsh.

I grabbed sharedemail.module from CVS and threw it onto my site. It works, and there haven't been any issues in the last few minutes. I was able to make three accounts with the same email address. The only hitch is that I have to find/replace all the sharedemail_ instances from my mail and init fields in the user table, as that still does continue to throw an error.

Given that is was touted as a live-site-worthy release with the bug, it might be worthwhile to have a cleanup query added for update.php to run before the next release gets pushed.

muhleder’s picture

The sql to replace them all is

update users set mail = REPLACE(mail, 'sharedemail_', ''), init = REPLACE(init, 'sharedemail_', '');

Prob too much bother/cruft to put this into an install check imo.

aufumy’s picture

I think muhleder's sql statement should be enough for now. In the future I think it is a good idea to add items to the update handlers.

no worries ao5357, I actually ended up not needing to use this module, so I do not myself run into issues right away.

Frankly, I am happy to hear that there are people using this module, and might obtain some benefit from it.

However, on the other hand, if anybody is interested to become the module maintainer, or be added as a developer, let me know.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.