U4-4929 - Member administration no longer works after upgrade to 7.1

Created by Robert Mulder 15 May 2014, 16:14:11 Updated by Shannon Deminick 26 Jun 2017, 05:41:32

I've upgraded our 7.0 installation to 7.1.1 using the instructions provided by the documentation http://our.umbraco.org/documentation/Installation/Upgrading/ (checked both specific and general) but after the upgrade the Member administration no longer works correctly.

Most notably, I can no longer save the Comments and IsApproved values. Any custom fields I add to the member type do still work.

I've tried both Web.config Membership settings:

Old:

And New

In both situations the data is not saved. But because of this all users don't seem to work because they are all set to not IsApproved any time they are saved.

Any suggestions on how I can fix this?

Comments

Robert Mulder 15 May 2014, 20:50:07

To provide some additional info, this is what gets posted when I try to save the member details in the Umbraco backend:

{ "action" : "save", "contentTypeAlias" : "Member", "email" : "email@example.com", "id" : 1218, "key" : "b72d64370cc24e24879a822ee2bd741b", "memberGroups" : [ "Schedule access" ], "name" : "Robert Mulder", "parentId" : -1, "password" : null, "properties" : [ { "alias" : "umbracoMemberComments", "id" : 1665, "value" : "blaat" }, { "alias" : "umbracoMemberFailedPasswordAttempts", "id" : 1666, "value" : "0" }, { "alias" : "umbracoMemberApproved", "id" : 1667, "value" : "1" }, { "alias" : "umbracoMemberLockedOut", "id" : 1668, "value" : "No" }, { "alias" : "umbracoMemberLastLockoutDate", "id" : 1669, "value" : "" }, { "alias" : "umbracoMemberLastLogin", "id" : 1670, "value" : "15/05/2014 21:37:21" }, { "alias" : "umbracoMemberLastPasswordChangeDate", "id" : 1671, "value" : "15/05/2014 17:43:59" }, { "alias" : "passwordRetrievalQuestion", "id" : 1675, "value" : "sdfsdfsadf" }, { "alias" : "portalObjects", "id" : 1672, "value" : "B5" }, { "alias" : "umbracoMemberPasswordRetrievalAnswer", "id" : 1673, "value" : "" }, { "alias" : "umbracoMemberPasswordRetrievalQuestion", "id" : 1674, "value" : "" } ], "username" : "email@example.com" }

This post request gets processed by the Umbraco.Web.Editors.MemberController PostSave() method, which takes a Umbraco.Web.Models.ContentEditing.MemberSave object as parameter which does not at all resemble the posted structure.

It seems as though the Member edit form in the backend my installation uses is not the latest/correct version.

I hope this helps with figuring out what is going on here. The upgrade from 7.0.4 to 7.1.1 went very smoothly otherwise, but clearly something was missed.


Shannon Deminick 16 May 2014, 02:15:21

I can't replicate this in the latest 7 version. Can you check what your property type aliases are for approved and comments on your member type and let me know ?


Robert Mulder 16 May 2014, 07:03:34

Approved uses property alias umbracoMemberApproved, comment uses umbracoMemberComments.

I've added a comment with the complete post to the server with all property values. I hope that helps.


Robert Mulder 20 May 2014, 08:29:13

I've done some digging around and found the source of the problem after performing a fresh 7.1.1 installation and comparing it to my 7.0.2 upgrade to 7.1.1 (via NuGet update package).

What I've noticed is that the content of umbraco.services.js is not the same. This is what it says in my upgraded 7.1.1:

var memberProviderPropAliases = _.pairs(displayModel.fieldConfig); _.each(displayModel.tabs, function (tab) { _.each(tab.properties, function (prop) { var foundAlias = _.find(memberProviderPropAliases, function(item) { return prop.alias === item[1]; }); if (foundAlias) { //we know the current property matches an alias, now we need to determine which membership provider property it was for // by looking at the key switch (foundAlias[0]) { case "umbracoLockPropertyTypeAlias": saveModel.isLockedOut = prop.value.toString() === "1" ? true : false; break; case "umbracoApprovePropertyTypeAlias": saveModel.isApproved = prop.value.toString() === "1" ? true : false; break; case "umbracoCommentPropertyTypeAlias": saveModel.comments = prop.value; break; } }
}); });

And this is the fresh install:

var memberProviderPropAliases = _.pairs(displayModel.fieldConfig); _.each(displayModel.tabs, function (tab) { _.each(tab.properties, function (prop) { var foundAlias = _.find(memberProviderPropAliases, function(item) { return prop.alias === item[1]; }); if (foundAlias) { console.debug(prop.alias, foundAlias[0]); //we know the current property matches an alias, now we need to determine which membership provider property it was for // by looking at the key switch (foundAlias[0]) { case "umbracoMemberLockedOut": saveModel.isLockedOut = prop.value.toString() === "1" ? true : false; break; case "umbracoMemberApproved": saveModel.isApproved = prop.value.toString() === "1" ? true : false; break; case "umbracoMemberComments": saveModel.comments = prop.value; break; } }
}); });

Notice how the property aliasses are different. The line numbers are also very different for this section of code (6929 for my upgrade version vs 7368 in the fresh install).

Maybe I'm just not familiar enough with the NuGet upgrade process, but these files should've been updated as well right? Did I do something wrong here? I've completed the steps as described in the upgrade document, but now I wonder what else didn't upgrade properly...

One thing to note though, I do have all the umbraco files included in my project (and source control), for publishing purposese. Perhaps this somehow interferes with the upgrade process?


Shannon Deminick 20 May 2014, 08:37:05

Good find!

@sebastiaan knows more about the Nuget process than i do. Seb I think this has come up before in other issues?


Robert Mulder 20 May 2014, 08:42:50

Maybe completely unrelated, but upgrading via NuGet (Upgrade-Package UmbracoCms) also apparently gives me the following error:

& : File C:\Umbraco Solution\packages\UmbracoCms.Core.7.1.3\tools\install.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Po licies at http://go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:3

  • & 'C:\Umbraco Solution...
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    
    
    

Looking at the content of the ps1 file it seems this is only backup related though, so I guess it isn't important for my issue.


Robert Mulder 20 May 2014, 08:51:38

Oh, one more thing that may be important. When installing a clean Umbraco installation via NuGet, the 'umbraco' and 'umbraco_client' directories (which contain these files) are not included in the Visual Studio project. They are copied as part of the NuGet installation, but to allow for publishing they need to be included in the project.

My knowledge of NuGet is limited to using it, but I thought maybe the NuGet update process also has some relation to files that are or are not included in the project.


Sebastiaan Janssen 21 May 2014, 09:11:34

@mulder@creativeid.nl No they are published just fine, we've included a targets file for that.

It is REALLY strange that your execution policy is restricted, not sure how that happens as NuGet should "just" work. but if you get this error make sure to set it properly in your package manager console, execute:

Set-ExecutionPolicy RemoteSigned

So, what may or may not have happened for you at the moment is some automation which needs to be done, your best option right now is to download the normal umbraco release (http://our.umbraco.org/ReleaseDownload?id=124229) and take the bin, umbraco and umbraco_client folder from that and copy it into your site overwriting what's there. Again, this is what the NuGet package USUALLY does for you but it might've gone wrong, so I'm just trying to ensure you have the correct files in place. I've addressed a bunch of NuGet issues in 7.1.3 already but will keep improving future versions.

One area of great big problems I've seen with NuGet in the past few weeks is that it is conflicting with ReSharper a lot. Again, the fixes I'm putting in are trying to work around that but I have to rely on the execution policy to be correct (many other nuget packages rely on that as well).


Sebastiaan Janssen 21 May 2014, 09:18:25

And finally, make sure you have the latest NuGet version installed, at least 2.8 (in VS: Tools > Extensions and updates > Updates)


Robert Mulder 21 May 2014, 11:47:54

I've checked the NuGet version, it's the latest. I'm also not using ReSharper, so that's certainly not the problem. Using Get-ExecutionPolicy in the Packages Manager it returns the value "RemoteSigned", so I'm not sure what's going on there...

I've tried to create a fresh installation of version 7.0.2 and performed an upgrade to 7.1.3 which worked just fine, regardless of whether or not I included the files in my project or even changed the files. In all cases the files are overwritten just fine.

The only thing different between this test environment and the development environment in which I see that the upgrade does not overwrite the file is that the dev environment is source controlled (though I did check out all files before the upgrade), does that ring any bells?


Sebastiaan Janssen 21 May 2014, 12:08:51

Hmm, nope but I'm guessing from "I did check out all files" that this is TFS? Not familiar with that one myself unfortunately.


Steve Brown 30 Jul 2014, 13:31:06

I think I may have found a related issue in umbraco 6.2.1, possibly related to the changes identified in umbraco.services.js above. Trace log is getting filled with errors trying to access the old Member properties, i.e. http://our.umbraco.org/forum/developers/api-questions/53189-Excessive-amount-of-log-entries-with-new-Member-model-in-v62


Phil Dye 29 Aug 2014, 13:29:43

I'm also seeing this same error logged in the UmbracoTraceLog.txt, in a clean install (ie not upgraded) of 7.1.6

2014-08-29 13:21:48,760 [6] WARN Umbraco.Core.Models.Member - [Thread 24] Trying to access the 'PasswordQuestion' property on Umbraco.Core.Models.Member but the umbracoMemberPasswordRetrievalQuestion property does not exist on the member type so a default value is returned. Ensure that you have a property type with alias: umbracoMemberPasswordRetrievalQuestion configured on your member type in order to use the 'PasswordQuestion' property on the model correctly.


Shannon Deminick 26 Jun 2017, 05:41:32

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.1.1, 7.1.6

Due in version:

Sprint:

Story Points:

Cycle: