From 2e482fdc2acb18d9cdaba03c5724e74d76a1c240 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 1 Feb 2024 18:36:23 +0100 Subject: [PATCH 1/3] Relocation of myaac tables check Makes more sense, between $db connection and migrate.php --- admin/index.php | 5 ----- index.php | 5 ----- system/init.php | 5 +++++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/admin/index.php b/admin/index.php index 3d7fc2a8..15ab133c 100644 --- a/admin/index.php +++ b/admin/index.php @@ -25,11 +25,6 @@ define('PAGE', $page); require SYSTEM . 'functions.php'; require SYSTEM . 'init.php'; -// verify myaac tables exists in database -if(!$db->hasTable('myaac_account_actions')) { - throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting this url.'); -} - require __DIR__ . '/includes/debugbar.php'; require SYSTEM . 'status.php'; require SYSTEM . 'login.php'; diff --git a/index.php b/index.php index 9eb2601e..c8c65419 100644 --- a/index.php +++ b/index.php @@ -69,11 +69,6 @@ $template_place_holders = array(); require_once SYSTEM . 'init.php'; -// verify myaac tables exists in database -if(!$db->hasTable('myaac_account_actions')) { - throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting this url.'); -} - require_once SYSTEM . 'template.php'; require_once SYSTEM . 'login.php'; require_once SYSTEM . 'status.php'; diff --git a/system/init.php b/system/init.php index 8ff47583..50c79862 100644 --- a/system/init.php +++ b/system/init.php @@ -134,6 +134,11 @@ $ots = POT::getInstance(); $eloquentConnection = null; require_once SYSTEM . 'database.php'; +// verify myaac tables exists in database +if(!$db->hasTable('myaac_account_actions')) { + throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting this url.'); +} + // execute migrations require SYSTEM . 'migrate.php'; From 08e7cf05b5126613d0f30211e4466eddec65a86c Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 1 Feb 2024 19:00:44 +0100 Subject: [PATCH 2/3] Remove link, looks bad on Whoops --- system/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/init.php b/system/init.php index 50c79862..db1045b4 100644 --- a/system/init.php +++ b/system/init.php @@ -136,7 +136,7 @@ require_once SYSTEM . 'database.php'; // verify myaac tables exists in database if(!$db->hasTable('myaac_account_actions')) { - throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting this url.'); + throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . BASE_URL . 'install'); } // execute migrations From f7971a21d8dc134fea0f285ce69339254b3f5b92 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 1 Feb 2024 20:43:46 +0100 Subject: [PATCH 3/3] An attempt to bypass the error --- system/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/init.php b/system/init.php index db1045b4..ec61b459 100644 --- a/system/init.php +++ b/system/init.php @@ -135,7 +135,7 @@ $eloquentConnection = null; require_once SYSTEM . 'database.php'; // verify myaac tables exists in database -if(!$db->hasTable('myaac_account_actions')) { +if(!defined('MYAAC_INSTALL') && !$db->hasTable('myaac_account_actions')) { throw new RuntimeException('Seems that the table myaac_account_actions of MyAAC doesn\'t exist in the database. This is a fatal error. You can try to reinstall MyAAC by visiting ' . BASE_URL . 'install'); }