Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I've upgraded the CMS from version 7.4.1 to version 7.10.3 and 7.10.4. The problem occurs in both versions.
When I'm trying to publish some changes to a page I get an error message saying 'username cannot be null or whitespace'.
Tried to log in and out, different browsers, but no luck.
Restored config-files, did not help.
Posted this in a similar thread, but since it's resolved it will probably be missed.
Posted the Stacktrace in my previous question.
Any one got any ideas?
It sounds like the user you are using does not have a username. I take it you have checked all your users to make sure they are correct? I know the users section was upgrade in a version between your two versions, so maybe something is not right there.
I have upgraded a couple of sites of similar versions, and have not encountered this issue, so i can not provide any more information/help.
I've checked the old and upgraded db and userName isn't empty in any of them. Created a new user but got the same error with that.
This is just a guess, but in the more recent versions of Umbraco there is a new setting that defaults to member usernames being the email address. Most old Umbraco sites probably have the username as the login name for members, but if you don't change this setting then it may be confusing Umbraco.
So I would check /config/umbracoSettings.config
Look within the <security> section.
Ensure you have the following within there:
(If it's not there, create it).
You can compare your current config to the default one in 7.10.4 to ensure you have merged all changes. A good diff tools is handy for this! Same goes for all config files.
I'm not saying this will fix the issue, just something to try.
I'd also clear all your cookies for the site, too, or try logging in via an incognito window.
I added the configuration, but got the same error with both true and false. Changed the username to the email, but no difference.
Tried incognito mode in different browsers with the same result.
There was no change in the /config/umbracoSettings.config during the upgrade.
Just a thought because I have no idea what changed between those versions, but could it be that it is some kind of database constraint/foreign-key issue?
Something like a link to a "published by/ created by/edited by" field that could previously be empty, and not anymore? So when you load it it's OK, but when you try to save/publish it, then it sees the field is empty and starts complaining...
The problem occurs in the backoffice when I press the save and publish button, and a call is made to to /umbraco/backoffice/UmbracoApi/Content/PostSave
When I debug, however, System.Web.HttpContext.Current.User.Identity.Name is empty, but that occurs in new and old version. But I'll dig more in this.
I'm getting confused, I log in to the backoffice with one user. Browsing to a page on the site and my user is unknown. Checked these:
var uh = new UmbracoHelper(UmbracoContext);
var sim = OwinContext.GetBackOfficeSignInManager();
var cu = UmbracoContext.Security.CurrentUser; //null
var uin = System.Web.HttpContext.Current.User.Identity.Name; //""
var n = uh.MembershipHelper.CurrentUserName; //""
var amName = sim.AuthenticationManager.User.Identity.Name; //""
var signInStatus = sim.PasswordSignInAsync("user", "password", false, false).Result;
var cu2 = UmbracoContext.Security.CurrentUser;//null
var uin2 = System.Web.HttpContext.Current.User.Identity.Name;//"user"
var amName2 = sim.AuthenticationManager.User.Identity.Name;//"user
var n2 = uh.MembershipHelper.CurrentUserName;//"user"
If I reload the backoffice I'm the new user, but on the site I'm still unknown.
But I can still not publish a page.
I noticed that the content is saved and "marked to be published". If I leave the page I get "You have unsaved changed" dialog, but when I choose discard my changes are saved. And if I recycle the app pool my changes are published and the history have a username. So for some reason doesn't the context know my user, when I'm trying to save and or publish, but at the same time adding to the history works fine.
I looked in the Umbraco.Web.Editors.ContentController and it seems to have many checks on the current user, but according to my debugging those should fail before the save.
Or am I missing any steps there that makes all this clear?
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted