MediaContentSelectorView returning draft version of image

Posted by Community Admin on 03-Aug-2018 18:19

MediaContentSelectorView returning draft version of image

All Replies

Posted by Community Admin on 07-Apr-2011 00:00

Hi,

I've got the mediacontentselectorview in a control designer im working on. When I select an item in the list, the following code is called:

imageSelected: function (sender, args)
 
    //set the global variable SelectedMediaDataItem for use later
    var dataItem = args.get_dataItem();
    alert(dataItem.Id);
    alert(dataItem.Title);
    this.set_SelectedMediaDataItem(dataItem);
 
,

When the Id is alerted, it is not the ID of the version of the image in the database that is published. For example, the value 697C9285-665E-4BF6-A689-73020B27BB51 is alerted, and if you look at the attached screenshot from SQL, this is not the LIVe version of the file.

Is this a bug, or am I doing something wrong?

Thanks
higgsy

Posted by Community Admin on 08-Apr-2011 00:00

Hi higgsy,

I do not see the the screenshot attached, but looking at the code of the MediaContentSelecorView I see that it gets the items with status LIVE. I suppose that you are not performing the binding.
The selector should return the correct LIVE items.
All media items are stored inside [sf_media_content]. There is a column [status] where per persist the item stats

 0 - Master
 1-  Draft
 2 - Live

All the best,
Ivan Dimitrov
the Telerik team


Posted by Community Admin on 08-Apr-2011 00:00

Hi Ivan,

Ok - if status of 2 is the live version then the mediacontentselectorview is returning the correct version - my mistake. I questioned it because in the sf_media_content table, the version with the status of 0 has a content_state of "published" whereas the other versions do not....but anyway, if zero is the live version then its not a problem.

Thanks for the clarification.

Regards,
higgsy

This thread is closed