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
e7be2559
Commit
e7be2559
authored
May 27, 2018
by
Robert Lyon
Committed by
Gerrit Code Review
May 27, 2018
Browse files
Merge "Bug 1773247: bad sql query in files bulk_delete"
parents
9b8b8ad5
5f6a89a7
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/artefact/file/lib.php
View file @
e7be2559
...
...
@@ -1480,7 +1480,11 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
// Get all files so that we can delete the files on filesystem
$filerecords
=
get_records_sql_assoc
(
'
SELECT aff1.*, a.artefacttype
SELECT aff.*, art.artefacttype
FROM {artefact_file_files} aff
JOIN {artefact} art ON aff.artefact = art.id
WHERE fileid IN (
SELECT fileid
FROM {artefact_file_files} aff1
JOIN {artefact} a ON aff1.artefact = a.id
WHERE artefact IN ('
.
$idstr
.
')
...
...
@@ -1488,7 +1492,8 @@ class ArtefactTypeFile extends ArtefactTypeFileBase {
HAVING COUNT(aff1.artefact) IN
(SELECT COUNT(aff2.artefact)
FROM {artefact_file_files} aff2
WHERE aff1.fileid = aff2.fileid)'
WHERE aff1.fileid = aff2.fileid)
)'
);
// The current rule is that file deletion should be logged in the artefact_log table
...
...
Write
Preview
Supports
Markdown
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