Components page: Stop if there is database error
parent
43148d3f17
commit
6fcc6da51c
|
@ -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';
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue