Skip to content

Commit a83f1b6

Browse files
committed
remove duplicate delete_records call
1 parent 369e887 commit a83f1b6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

view.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,9 @@
9393
exit();
9494
}
9595

96-
// Delete the issue.
97-
$DB->delete_records('customcert_issues', ['id' => $deleteissue, 'customcertid' => $customcert->id]);
9896
// Always delete local copy.
9997
if ($candeletelocalcopy) {
100-
$issues = $DB->get_records('customcert_issues', array('id' => $deleteissue, 'customcertid' => $customcert->id));
98+
$issues = $DB->get_records('customcert_issues', ['id' => $deleteissue, 'customcertid' => $customcert->id]);
10199
if (!empty($issues)) {
102100
$lf = new \mod_customcert\localfile(new \mod_customcert\template($template));
103101
array_map(fn($issue) => $lf->deletePDF($issue->userid), $issues);
@@ -106,7 +104,7 @@
106104

107105
if (!$deletelocalcopy) {
108106
// Delete the issue.
109-
$DB->delete_records('customcert_issues', array('id' => $deleteissue, 'customcertid' => $customcert->id));
107+
$DB->delete_records('customcert_issues', ['id' => $deleteissue, 'customcertid' => $customcert->id]);
110108
}
111109

112110
// Redirect back to the manage templates page.

0 commit comments

Comments
 (0)