This project is read-only.

Identical users in separate blogs crashes platform (v3.1.1.0)

Topics: Controls
Jan 4, 2016 at 2:59 PM
Hi there,

While trying to test out the extensiveness of another problem, I created two separate users called 'test' in a pair of non-primary blogs. Having two users called 'test' then throws up a 'configuration error' message across the platform -

"Item has already been added. Key in dictionary: 'test' Key being added: 'test'"

I had to delete the users directly through the backend database, and that seemed to work fine. however is there a way to prevent this type of problem from occurring in the first place, asides from asking the administrators for the separate blogs to not add users to their blog without checking the others?

Thanks in advance!
Jan 4, 2016 at 3:56 PM
You would need modify membership provider (xml or db) to check for existence before adding new.

3.2 discourages from using multiple blogs with multiple users to avoid problem like this, among others.
Jan 4, 2016 at 4:08 PM
Excellent, thanks. Where would I modify it?

And would 3.2 also attempt to avoid multiple entries for identical usernames in the Profiles table? That's the error I was trying to replicate when I stumbled on this one.
Jan 4, 2016 at 5:17 PM
The code is in the core library, in db provider class:

CreateUser method allows multiple users with same name, as technically they have different blog ID.
You need to check for user name and throw error if exists.

3.2 doesn't modify code, just hides options in UI. But later code will be modified to follow single membership.