New module broke the existing Orchard

Topics: Core, Customizing Orchard, Troubleshooting
Jun 13, 2013 at 3:02 AM
Edited Jun 13, 2013 at 3:04 AM
I created a module like the tutorial did. Everything worked almost the same as the tutorial stated. Later, I modified the part definition. The two fields' names are changed. The corresponding codes are changed as well. I compiled, and went to the orchard administrator page.

The whole site broke. So I used the commandline tool to disable the module. The site went back. However, it no longer shows tag clouds, or feed burner. No matter what I do now, these modules do not work anymore.

These modules are not related to the newly created module at all. I want to know how to trouble shoot this case, and what are the possible reasons?
Jun 26, 2013 at 6:46 AM
What tutorial is that? Did you use a migration to modify the part definition?

When working on code, you should always be ready to reset your database if necessary.
Jun 28, 2013 at 6:33 AM

I assumed this is the first tutorial one needs to read before creating any module.

What I did was the following:
  1. Went through the tutorial and everything worked perfectly.
  2. I changed the Part Record fields' names and types. Compiled, and the orchard site was down.
  3. I disabled the module from cmdline.
  4. The site was back, but many enabled modules stopped working.
Now, I have re-installed the orchard, re-installed the module, and re-entered everything. It seems quite inconvenient to start it all over. I want to know what happened such that I don't have to repeat the error.

Jun 28, 2013 at 6:43 PM
Edited Jun 28, 2013 at 6:47 PM
Please look into App_Data/Logs and/or attach a debugger and look up what's going on.
If you changed part record field names and did not change column names in migrations - database queries will fail (provided you did the change after enabling the module) because of NHibernate mapping mismatch. Record property names must correspond to table column names.

If you did that, but still see the error, remove App_Data/Sites/<site name>/mappings.bin file to force NHibernate mappings cache to refresh.
Jun 28, 2013 at 7:32 PM
Thanks for the suggestion, I will try to look into the logs and debuggers. I did the corresponding changes in migration.cs and other places, by the way.

The problem that bothered me is that if some module is broken, and disabled afterwards, it shouldn't affect the other modules and the whole system, but I experienced the opposite. I am curious about if anyone has experienced similar situation, and if it is a default behavior.