Admidio / admidio

Admidio is a free open source user management system for websites of organizations and groups. The system has a flexible role model so that it’s possible to reflect the structure and permissions of your organization.
https://www.admidio.org
GNU General Public License v2.0
307 stars 123 forks source link

Improve DB Installation Check (#1537) #1585

Closed schast closed 3 months ago

schast commented 4 months ago

We have problems with the database check from time to time. Currently it is assumed that the database has already been initialized as soon as a config.php exists.

In most cases, the following error occurs:

PHP Fatal error:  Uncaught Error: Call to a member function fetchAll() on bool in /opt/app-root/src/adm_program/system/classes/Database.php:516
Stack trace:
#0 /opt/app-root/src/adm_program/system/classes/Database.php(442): Database->loadTableColumnsProperties()
#1 /opt/app-root/src/adm_program/system/classes/TableAccess.php(654): Database->getTableColumnsProperties()
#2 /opt/app-root/src/adm_program/system/classes/TableAccess.php(147): TableAccess->setColumnsInfos()
#3 /opt/app-root/src/adm_program/system/classes/TableAccess.php(109): TableAccess->clear()
#4 /opt/app-root/src/adm_program/system/classes/Session.php(62): TableAccess->__construct()
#5 /opt/app-root/src/adm_program/system/common.php(91): Session->__construct()
#6 /opt/app-root/src/adm_program/overview.php(18): require_once('...')
#7 {main}\n  thrown in /opt/app-root/src/adm_program/system/classes/Database.php on line 516
  127.0.0.1 "GET /adm_program/overview.php HTTP/1.1" 500 -

Therefore, the check should take place directly in the database and, if necessary, redirect to the installation page.

With the new check, the installation in the container can be significantly simplified, as most of the values are already available via the container configuration.

@Fasse: Can you please review the pull request (changes in adm_program) and test with a normal installation?

schast commented 4 months ago

current installation steps with Docker Container (6 steps with manually filled db options):

admidio_installation_orig_step01_installation admidio_installation_orig_step02_connect_database admidio_installation_orig_step03_create_organisazion admidio_installation_orig_step04_create_administrator admidio_installation_orig_step05_create_config admidio_installation_orig_step06_start_installation

schast commented 4 months ago

new installation steps with Docker Container (3 steps with automatically filled by docker env variables).

With this changes the other steps are automatically skipped since all options are already set in config file.

admidio_installation_step01_create_organization admidio_installation_step02_create_administrator admidio_installation_step03_start_installation