Referencing Two Custom Modules

Topics: Writing modules
Jun 22, 2012 at 5:16 PM

Module A has four fields and Module B has two field 

In the controller of Module A references are add and migration has the part of Module B models.

when I make called in the controller for Module A with content part of module B nothing is insert in the database for it and returns an error. 

What i'm doing is appending the models of Module B to Module A through Module B's Content Part.

To give a better Example:

So I created a module "Article" and it has TitlePart. In my controller I have...

 ContentItem article = _contentManager.New("Article");

article.As<TitlePart>().Title = news.headline;

What I'm Trying is...

article.As<SitePart>().PageType = "Article"; 

and I get the following error...

"null id in Orchard.Alias.Records.AliasRecord entry (don't flush the Session after an exception occurs)" I removed the flush call and same this...

Jun 25, 2012 at 5:13 AM

Figured out my problem... It was in the handler for Module B. Validated that Module B's fields were creating but not if they were being populated. :)