Commit 310b061d authored by Robert Lyon's avatar Robert Lyon
Browse files

Bug 1632863: Proper way to remove embedded image



behatnotneeded

Change-Id: I2fac457da7d58c8bd9cd14674931bfbecc3b530e
Signed-off-by: default avatarRobert Lyon <robertl@catalyst.net.nz>
parent b1c09465
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -326,10 +326,9 @@ class ArtefactTypeAnnotation extends ArtefactType {
            $feedback->delete();
        }

        // Delete any embedded images for this annotation.
        // Don't use EmbeddedImage::delete_embedded_images() - it deletes by
        // the fileid. We need to delete by the resourceid.
        delete_records('artefact_file_embedded', 'resourceid', $this->id);
        // Remove any embedded images for this annotation.
        require_once('embeddedimage.php');
        EmbeddedImage::remove_embedded_images('annotation', $this->id);
        delete_records('artefact_annotation', 'annotation', $this->id);
        parent::delete();
        db_commit();