Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
31ae2650
Commit
31ae2650
authored
Apr 13, 2010
by
Richard Mansfield
Browse files
Don't try to detach files using old feedback tables when deleting
Signed-off-by:
Richard Mansfield
<
richardm@catalyst.net.nz
>
parent
ee615bbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/lib.php
View file @
31ae2650
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment