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