Commit 31ae2650 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Don't try to detach files using old feedback tables when deleting


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent ee615bbf
...@@ -958,8 +958,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase { ...@@ -958,8 +958,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
return; return;
} }
$file = $this->get_path(); $file = $this->get_path();
// Detach this file from any view feedback
set_field('view_feedback', 'attachment', null, 'attachment', $this->id);
if (is_file($file)) { if (is_file($file)) {
$size = filesize($file); $size = filesize($file);
// Only delete the file on disk if no other artefacts point to it // Only delete the file on disk if no other artefacts point to it
...@@ -1014,7 +1012,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase { ...@@ -1014,7 +1012,6 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
// log deletion for all these files if at least one is group-owned. // log deletion for all these files if at least one is group-owned.
$log = (bool) count_records_select('artefact', 'id IN (' . $idstr . ') AND "group" IS NOT NULL'); $log = (bool) count_records_select('artefact', 'id IN (' . $idstr . ') AND "group" IS NOT NULL');
set_field_select('view_feedback', 'attachment', null, 'attachment IN (' . $idstr . ')', array());
delete_records_select('artefact_attachment', 'attachment IN (' . $idstr . ')'); delete_records_select('artefact_attachment', 'attachment IN (' . $idstr . ')');
delete_records_select('artefact_file_files', 'artefact IN (' . $idstr . ')'); delete_records_select('artefact_file_files', 'artefact IN (' . $idstr . ')');
parent::bulk_delete($artefactids, $log); parent::bulk_delete($artefactids, $log);
......
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