Current content for PropertyList item selection factory

Ted
Ted
Vote:
 

When attaching a SelectOne or SelectMany attribute to a POCO object property being edited as part of a PropertyList property, the ExtendedMetadata object only contains the POCO object. The Model property is null, and it seems there's no way of getting the current content being edited, i.e. the current IContent object.

public IEnumerable GetSelections(ExtendedMetadata metadata)
{
        var currentContent = metadata.FindOwnerContent(); // This is null
}

I briefly had an idea of getting the current content by parsing the URL, but since the URL is for the selection factory store, that doesn't help me much - that URL doesn't contain any information about the current content context.

Any bright ideas? :)

#143346
Jan 20, 2016 23:23
Vote:
 

That is basically what is done in the FindOwnerContent method. I don't think it works for PropertyList

#143350
Jan 21, 2016 10:22
Ted
Vote:
 

Thanks, Marija! I'm not sure that works, though?

It would normally, but when editing a PropertyList item (i.e. a POCO object) the selection factory REST store request simply includes the name of the selection factory type - there is no content context information.

That code sample could be replaced with the FindOwnerContent extension method, but regardless I still get null back. :/

Edit: Right, like Per said. :)

#143351
Edited, Jan 21, 2016 10:23
Vote:
 

Hi!

Old thread, I know! But... did you ever find a soloution for this? I'm running into the same problem :)

#187452
Jan 23, 2018 11:32
Vote:
 

If you have latest version of Epi and it still doesn't, it sounds like it should be reported as a bug to Episerver support. I couldn't find a bug report, see this.

#187453
Jan 23, 2018 11:51
Vote:
 

I got this answer from Episerver today 2018-06-19

"We're developing a story that will fix this issue. The story will be released in CMS UI 12 that requires some breaking changes."

#194307
Jun 19, 2018 10:49