Xibo API: LayoutRegionMediaDelete error

Hi, i’m trying to remove a text media from a region by using the LayoutRegionMediaDelete API call, but i get a 500 error. I think that the code responsible of this error is in file lib/service/rest.class.php :

$entry = Media::Entries(null, array('mediaId' => $mediaId));
if (count($entry) <= 0)
    return $this->SetError(__('Error getting type from a media item.'));

because the return value of the function Media::Entries is always “0” for media of type text.

Hi,

Sorry for the delay.
It looks like that API call only works for File based media. It will be fixed in version 1.8.
As a workaround you could use LayoutRegionMediaEdit providing the region XML without the text item.

Thanks,
Peter