Commit 310c09fe authored by Cecilia Vela Gurovic's avatar Cecilia Vela Gurovic Committed by Cecilia Vela Gurovic
Browse files

Bug 1646284: Deleting a group with warnings artefact/html

behatnotneeded

Change-Id: Iaf0615385534478872a11ffe22fb374ca689ad06
parent c779256c
......@@ -739,15 +739,17 @@ abstract class ArtefactType implements IArtefactType {
safe_require('artefact', 'comment');
ArtefactTypeComment::delete_comments_onartefacts($artefactids);
$records = get_records_select_assoc(
'artefact',
'id IN (' . join(',', array_map('intval', $artefactids)) . ')',
null, 'artefacttype', 'id,parent,artefacttype,container'
);
$sql = 'SELECT a.id, a.parent, a.artefacttype, a.container, i.plugin
FROM {artefact} a
JOIN {artefact_installed_type} i ON a.artefacttype = i.name
WHERE a.id IN (' . join(',', array_fill(0, count($artefactids), '?')) . ')'.
' ORDER BY artefacttype';
$records = get_records_sql_assoc($sql, $artefactids);
$containers = array();
$leaves = array();
foreach ($records as $r) {
safe_require('artefact', $r->plugin);
if ($r->container) {
$containers[$r->artefacttype][] = (int)$r->id;
}
......@@ -756,7 +758,6 @@ abstract class ArtefactType implements IArtefactType {
}
}
safe_require('artefact', 'file');
// Delete non-containers grouped by artefacttype
foreach ($leaves as $artefacttype => $ids) {
$classname = generate_artefact_class_name($artefacttype);
......
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