Hi Son,
I'm also getting this issue on master (15.04). There are 2 scenarios:
1. /artefact/file/download.php
A file is embedded in any artefact that can have an image embedded (i.e. 'comment', 'blog', 'textbox', 'editnote', 'text').
We need to check EmbeddedImage::can_see_embedded_image() when embedded = 1 and the file is instanceof ArtefactTypeImage.
The code in download.php checks this but only for resume elements and groups.
It also needs to check: - when 'view' is specified - when view is not specified and is still not visible after all those other checks.
2. When an artefact/block is deleted from a view, it uses:
EmbeddedImage::delete_embedded_images()
which deletes based on the fileid.
So, if the fileid is used in more than one place by the user, it will delete all records in the 'artefact_file_embedded' table.
It should delete based on the resourceid.
I'm not sure what the original business case was for using fileid. We'll need to investigate further and see where it's required by fileid.
I hope this makes sense.
Thanks, Ghada
Hi Son,
I'm also getting this issue on master (15.04). There are 2 scenarios:
1. /artefact/ file/download. php
A file is embedded in any artefact that can have an image embedded (i.e. 'comment', 'blog', 'textbox', 'editnote', 'text').
We need to check EmbeddedImage: :can_see_ embedded_ image() when embedded = 1 and the file is instanceof ArtefactTypeImage.
The code in download.php checks this but only for resume elements and groups.
It also needs to check:
- when 'view' is specified
- when view is not specified and is still not visible after all those other checks.
2. When an artefact/block is deleted from a view, it uses:
EmbeddedImage: :delete_ embedded_ images( )
which deletes based on the fileid.
So, if the fileid is used in more than one place by the user, it will delete all records in the 'artefact_ file_embedded' table.
It should delete based on the resourceid.
I'm not sure what the original business case was for using fileid. We'll need to investigate further and see where it's required by fileid.
I hope this makes sense.
Thanks,
Ghada