Skip to content

Commit

Permalink
bugfix: show upload validation notification only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhilton committed Jul 8, 2024
1 parent d29bb73 commit d3e55db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand All @@ -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'));
}
Expand Down

0 comments on commit d3e55db

Please sign in to comment.