CreateDefaultLayers never called?

Topics: General, Writing modules
Jul 12, 2011 at 8:28 AM

Does someone know when the function DefaultLayersInitializer::CreateDefaultLayers() (Orchard.Widgets) is called?

I debugged a new installation of Orchard. I put a break point in this function and it was never hit.

This function seems to create the layers "Default", "Authenticated", "Anonymous" and "Disabled" but actually they seem to be created by the following lines in the Command section of the recipe file:

layer create Default /LayerRule:"true"   

layer create Authenticated /LayerRule:"authenticated"   

layer create Anonymous /LayerRule:"not authenticated"   

layer create Disabled /LayerRule:"false"


I want to create default records (not content items) and I thought I could use something similar to CreateDefaultLayers. Looks like that doesn't work... Should I create these records in the class wich inherits from DataMigrationImpl or should I create a command such as 'layer create' and call it through the recipe file?



Jul 13, 2011 at 8:02 PM

I think that's dead code. Would you mind filing a bug in the issue tracker for that?

To answer your question, you don't have to write commands necessarily unless that is what you are trying to do, but I would definitely look at the code for those command handlers.

Jul 15, 2011 at 7:39 AM

Thanks Bertrand.

I filled a bug in the issue tracker: #18018

I wrote commands but I'll be interested in using something else.