Commit b21e0edb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Detach files in parent cache before deleting blog posts (bug #506755)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 8462db20
......@@ -1038,6 +1038,14 @@ abstract class ArtefactType {
public function detach($attachmentid=null) {
if (is_null($attachmentid)) {
execute_sql("
DELETE FROM {artefact_parent_cache}
WHERE parent = ?
AND artefact IN (
SELECT attachment
FROM {artefact_attachment}
WHERE artefact = ?
)", array($this->id, $this->id));
delete_records('artefact_attachment', 'artefact', $this->id);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment