Components page: Stop if there is database error

main
Yasen Pramatarov 2024-11-17 14:11:22 +02:00
parent 43148d3f17
commit 6fcc6da51c
1 changed files with 68 additions and 63 deletions

View File

@ -4,12 +4,15 @@ require '../app/classes/component.php';
// connect to database
$response = connectDB($config, 'jilo', $platformDetails[0]['jilo_database'], $platform_id);
// if DB connection has error, display it and stop here
if ($response['db'] === null) {
$error = $response['error'];
include '../app/templates/block-message.php';
// otherwise if DB connection is OK, go on
} else {
$db = $response['db'];
}
// specify time range
include '../app/helpers/time_range.php';
@ -88,4 +91,6 @@ if (!empty($components['records'])) {
// display the widget
include '../app/templates/event-list-components.php';
}
?>