Ticket #454 (closed defect: ready_for_review)
[workflow] node edit & checkbox delete video
|Reported by:||peter||Owned by:||robert|
|Priority:||major||Milestone:||WLE modules into D6|
|MoSCoW:||Should Have||Estimated time after impact analysis:|
|Related to project:||none||Tested:||no|
Description (last modified by MC-arjen) (diff)
Current situation: the checkbox "delete video" is checked, the node is saved but nothing happens in mediamosa
Problem: pollution of mediamosa
1) The checkbox "Delete the Video" should also result in an empty asset.
2) The position of the checkbox should be in the fieldset "Attach a media file to upload MediaMosa".
3) When the checkbox has been set the mediafiles & stills should be removed. The asset should remain because of the metadata that can be available.
How to implement:
You can not use /asset/delete here. Because you delete the asset, and the problem is that we remove the asset while the node is still active. Also deleting the asset will remove the metadata.
Use /asset/$asset_id/mediafile call to get the asset mediafiles and figure out the mediafiles that are under the asset. Also delete the still(s) as well, so all we want to delete all mediafiles under this asset.
Loop the found mediafiles.
Delete the mediafile with /mediafile/$mediafile_id/delete and use parameter 'delete' with value 'cascade'. Could be that if you try to delete a mediafile and its already deleted, it will give back a failure. Then ignore the failure; the mediafile is gone anyway. Remember you need to provide the owner of the mediafile you want to delete.