Why does API Call LayoutRegionMediaDelete removes Media not only from Region but also tries to delete from DB-Tabel "lklayoutmedia" ?

Asked by Bodo Teichmann

I found the the API Call LayoutRegionMediaDelete first removes the specified Media from the specified Region. But then it also tries to delete the Media from DB-table "lklayoutmedia".
But if the Media is also part for another Region the function call Media->Delete($mediaId) fails, and returns an error message. The calling party cannot differentiate whether the removal from the Region did fail already , or just the removal from DB-Tabel "lklayoutmedia".
Therefore I would expect that LayoutRegionMediaDelete() just removes the Media from the specified Region, not more.
For deleting a Media entirely there is already another API Call "LayoutRegionMediaDelete()" for that purpose.

Therefore I propose to delete the Line "if (!$media->Delete($mediaId)) return $this->Error($media->GetErrorNumber(), $media->GetErrorMessage());" from public function LayoutRegionMediaDelete()

Kind Regards
Bodo

Question information

Language:
English Edit question
Status:
Answered
For:
Xibo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan Garner (dangarner) said :
#1

Thank you for reporting this - I have created a bug.

Can you help with this problem?

Provide an answer of your own, or ask Bodo Teichmann for more information if necessary.

To post a message you must log in.