This project is read-only.

Part field won't save

Topics: Troubleshooting, Writing modules
Sep 15, 2011 at 9:21 PM

I have a part that I finished writing this morning.  Everything was working fine, until I had to add another property to my part.  What I've done a bunch of times in the past when this scenario occurs is to add my property to the migration and then to the model, and then run this script:

delete from Orchard_Framework_DataMigrationRecord where DataMigrationClass = 'MyObject.Migrations'
drop table Laughlin_MyObject_MyObjectPartRecord

This effectively uninstalls the part from the site.   I then reset IIS, build, and hit the admin page so it tells me I have updates that need to happen.  After I run the update, my migration recreates the tables, and all is well.

This time around, though, I'm seeing some very strange behavior.  I go through the above process, the new property is added to the table via the migration, but I can't get that property to be recognized by nhibernate to push the value into the database.

I ran SQL profiler and it shows an update statement with all my other properties on it, but any new properties I add are promptly ignored.  I reset IIS, rebuilt, tried everything I could think of, but it still won't recognize my new properties.  Is there some place I can look to see if maybe a mapping file isn't updated or something?  Any help is appreciated...

Sep 23, 2011 at 2:04 AM

No idea. I usually start over in those situations instead of trying to hack the database back into a previous state.

Oct 30, 2011 at 12:43 PM

I have had this SAME problem, and starting over is not an option for me, since I am simply updating a module for a site in production with all kinds of content already entered.  Has there been any other work done to provide a better answer for this?

Nov 1, 2011 at 12:54 AM

Another thing you can try is to delete the mappings file in app_data\sites\default and restart iis.