Skip to content

Commit

Permalink
Merge pull request #160 from marsante/fix-redirect-install.php
Browse files Browse the repository at this point in the history
fix: blank first page when cli  or file installation
  • Loading branch information
MedShake authored Aug 12, 2024
2 parents d6980ef + 34579e6 commit 302bf6c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
16 changes: 15 additions & 1 deletion public_html/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*
* @author Bertrand Boutillier <[email protected]>
* @contrib fr33z00 <https://www.github.com/fr33z00>
* @contrib Michaël Val
*/

ini_set('display_errors', 0);
Expand Down Expand Up @@ -68,7 +69,20 @@
$p['homepath'] = $homepath;

/////////// SQL connexion
$pdo = msSQL::sqlConnect();
try {
$pdo = msSQL::sqlConnect();
} catch (Exception $e) {
msTools::redirection('/install.php');
}

// Vérifier si la base de données existe et s'il y a des tables
$sql = "SHOW TABLES";
$stmt = $pdo->prepare($sql);
$stmt->execute();
$tables = $stmt->fetchAll(PDO::FETCH_COLUMN);
if (empty($tables)) {
msTools::redirection('/install.php');
}

/////////// État système
$p['config']['systemState'] = msSystem::getSystemState();
Expand Down
2 changes: 1 addition & 1 deletion upgrade/base/sqlInstall.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,7 @@ INSERT IGNORE INTO `prescriptions` (`cat`, `label`, `description`, `fromID`, `to

-- system
INSERT IGNORE INTO `system` (`name`, `groupe`, `value`) VALUES
('base', 'module', 'v8.1.1'),
('base', 'module', 'v8.1.2'),
('state', 'system', 'normal');

-- univtags_type
Expand Down
2 changes: 2 additions & 0 deletions upgrade/base/sqlUpgrade_v8.1.1_v8.1.2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- Mise à jour n° de version
UPDATE `system` SET `value`='v8.1.2' WHERE `name`='base' and `groupe`='module';
2 changes: 1 addition & 1 deletion versionMedShakeEHR-base.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v8.1.1
v8.1.2

0 comments on commit 302bf6c

Please sign in to comment.