This project is read-only.

CommonPart Container

Topics: Core
May 22, 2013 at 9:19 PM

I am creating a little module for Orchard where I have a parent child relationship between two contenttypes. Both types are draftable.

Game -> Objectives

I am using the Container field in the CommonPart to set the game as a container for the objective. I am doing this from a custom admin controller.

Creating goes fine, and everything is saved in the database. But when I edit the content the Container gives null when the container (Game) isn't published. So When I save again, the container is set to null, but I want to keep the unpublished game as the container.

I've found that in the CommonPartHandler the lazy loader of the Container only fetches published content items.
part.ContainerField.Loader(() => part.Record.Container == null ? null : _contentManager.Get(part.Record.Container.Id)); 
Is this on purpose? or is this a hidden bug?

Kind regards,
Sjoerd van der Meer
May 25, 2013 at 1:17 AM
Edited May 25, 2013 at 1:18 AM
It looks like a bug. Would you mind creating an issue for this so we can discuss during triage? Thanks. Also, are you joining us for the upcoming Orchard Harvest conference, since your name indicates you're in the neighborhood anyway. ;)
May 27, 2013 at 3:03 PM
Edited May 27, 2013 at 3:04 PM
I've filed an issue. Maybe I push a pull request later. About Orchard Harvest, I saw it a week ago and would really like to join in, but as a student I can't afford the entry fee :-/. So I hope the sessions will be recorded. Best of course when there are student fees ^^.