My module (non content item based) is hooking into the Orchard.Users module so that I can add Orchard Users to some of my tables.
When pulling out information for the Users, I came across an interesting and rather strange situation. I'm using the Contrib.Profile module to store additional information for the users such as First Name and Last Name. When I look at the ContentItemRecord
table in the database, not all of the user items have this information in the Data column. For the ones that don't have the profile information in the Data column, I found it in the ContentItemVersionRecord table.
So...I have a couple of questions about this:
First, why is some of the data being written to one table and some to the other?
Second, I have code that is erroring out because it's looking for the data in the ContentItemRecord table and is coming back null since the data is in the ContentItemVersionRecord table:
@user.User.ContentItemRecord.Data.Substring(user.User.ContentItemRecord.Data.IndexOf("") + 11, user.User.ContentItemRecord.Data.IndexOf("") - user.User.ContentItemRecord.Data.IndexOf("") - 11)
user is an instance of a model that contains an Orchard User record.
Any ideas on how I can either make sure the Profile data is being written to ContentItemRecord...or how I can access ContentItemVersionRecord?