From 4556ea22f217623a8efba24dc378e06973340cf8 Mon Sep 17 00:00:00 2001 From: Matthew Hilton Date: Tue, 9 Jul 2024 08:36:14 +1000 Subject: [PATCH] bugfix: show upload validation notification only when necessary --- upload.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/upload.php b/upload.php index dc0d2b7..840a7e2 100644 --- a/upload.php +++ b/upload.php @@ -129,7 +129,7 @@ echo $OUTPUT->header(); // List out any issues in a table. -if (!empty($errors)) { +if ($validate && !empty($errors)) { // Print summary statement. echo \core\notification::error(get_string('error:bookingsuploadfileerrorsfound', 'mod_facetoface', count($errors))); @@ -141,7 +141,9 @@ $table->data = $errors; echo html_writer::tag('div', html_writer::table($table), ['class' => 'flexible-wrap mb-4']); -} else { +} + +if ($validate && empty($errors)) { // Bonus: show a preview/summary for good records (e.g. 40 records will be processed). echo \core\notification::success(get_string('facetoface:uploadreadytoprocess', 'mod_facetoface')); }