Media picker linking by Id not OriginalContentId??

Posted by Community Admin on 04-Aug-2018 16:09

Media picker linking by Id not OriginalContentId??

All Replies

Posted by Community Admin on 23-May-2013 00:00

I had the following code, but the results on the front end were not showing me anything

protected void documentListView_NeedDataSource(object sender, RadListViewNeedDataSourceEventArgs e)
            LibrariesManager manager = LibrariesManager.GetManager();
            List<Guid> documentIds = this.ContentLinks.Select(x => x.ChildItemId).ToList();
            var docs = (from d in manager.GetDocuments()
                       where documentIds.Contains(d.OriginalContentId)
                       select d);
            ((RadListView)sender).DataSource = docs.OrderByDescending(x => x.LastModified);

When I modified it to this
where documentIds.Contains(d.OriginalContentId) || documentIds.Contains(d.Id)

...stuff appears again

This is the dynamic module builder document linker field type.  This concerns me because the Ids change when the doc changes right?

Posted by Community Admin on 24-May-2013 00:00

...source shows this to be the case, am I offbase here?

Posted by Community Admin on 28-May-2013 00:00

Hi Steve,

 Document.Id property is mapped to sf_media_content.content_id, which isn't changed in case of document modification.

OriginalContentId field holds the linkage between document's lifecycle versions (Live, Temp objects linked to Master one). 

So, if you modify the document in the backend, you'll not lose the linkage between the dynamic item and the document you eventually modified.

Boyko Nistorov
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed