And then the raw SQL entity returned for each User 'UserDto' is used to build an Umbraco IUser object in the UserFactory: calling the 'BuildEntity' method:
Which is the 'last error' in your trace, when constructing a new User object
var user = new User(dto.Id, dto.UserName, dto.Email, dto.Login,dto.Password,
dto.UserGroupDtos.Select(x => x.ToReadOnlyGroup()).ToArray(),
dto.UserStartNodeDtos.Where(x => x.StartNodeType == (int)UserStartNodeDto.StartNodeTypeValue.Content).Select(x => x.StartNode).ToArray(),
dto.UserStartNodeDtos.Where(x => x.StartNodeType == (int)UserStartNodeDto.StartNodeTypeValue.Media).Select(x => x.StartNode).ToArray());
And you can see, that for one of the Users that are affected by the group permissions change, and returned from the database via PetaPoco - it's UserName is empty... which throws the error....
So I would, as I said earlier (blimey that seems a long time ago) - just check to see if any entries in the umbracoUsers table have a null entry or not - and manually update them via SQL to be 'something' - there might be more than one and I guess the other issue could be if a User was deleted from the umbracoUsers table but somehow are still linked to a particular userGroup - there is a table that maps users to user groups - so if it's not an obvious empty username, it will be worth querying that to see if any users are mapped to usergroups that no longer have an entry in the umbracoUsers table!
After upgrade to Umbraco 7.15.5 - Parameter name: username - Value cannot be null or whitespace
Hi
We've upgraded about 40 sites from Umbraco 6.1.6 to Umbraco 7.15.5 (yes, we know about Umbraco 8 :)) and it worked great for all but one.
We're getting a strange error, that we haven't seen before, see below.
Anyone had problems with this?
Best Regards Thomas
Hi Thomas
Have a look in your umbracoUsers database table, do you somehow have a user in there with an empty username?
If you follow the stack trace through, the source code, it starts after making changes to UserGroup permissions 'PostSaveUserGroupPermissions'
https://github.com/umbraco/Umbraco-CMS/blob/e4e5e2d103b4f8ae93454c0b0ae088f3f7d1fc1b/src/Umbraco.Web/Editors/ContentController.cs#L160
that calls UserService ReplaceUserGroupPermissions
that, eventually dispatches an event called 'UserGroupPermissionsAssigned'
https://github.com/umbraco/Umbraco-CMS/blob/0bd4dced0b3e9205660114406b7e814f817179c7/src/Umbraco.Core/Services/Implement/UserService.cs#L754
that then is handled in a 'notification' class
https://github.com/umbraco/Umbraco-CMS/blob/2bfef741914297c802bc6c77cc48780d7534f920/src/Umbraco.Web/Compose/NotificationsComponent.cs#L145
Which then tries to get all the Users to notify, which eventually calls down to the repository level, to make a query via PetaPoco to the database:
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Core/Persistence/Repositories/Implement/UserRepository.cs#L878
And then the raw SQL entity returned for each User 'UserDto' is used to build an Umbraco IUser object in the UserFactory: calling the 'BuildEntity' method:
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Core/Persistence/Factories/UserFactory.cs#L10
Which is the 'last error' in your trace, when constructing a new User object
And you can see, that for one of the Users that are affected by the group permissions change, and returned from the database via PetaPoco - it's UserName is empty... which throws the error....
So I would, as I said earlier (blimey that seems a long time ago) - just check to see if any entries in the umbracoUsers table have a null entry or not - and manually update them via SQL to be 'something' - there might be more than one and I guess the other issue could be if a User was deleted from the umbracoUsers table but somehow are still linked to a particular userGroup - there is a table that maps users to user groups - so if it's not an obvious empty username, it will be worth querying that to see if any users are mapped to usergroups that no longer have an entry in the umbracoUsers table!
regards
marc
is working on a reply...