wintercms / web-installer

Web-based installer for Winter CMS
https://wintercms.com/
MIT License
30 stars 4 forks source link

SQLite is used when Database Type is not changed from default MySQL/MariaDB selection #20

Closed Domeman closed 3 years ago

Domeman commented 3 years ago

Winter CMS Build

dev-develop

PHP Version

8.0

Database engine

MySQL/MariaDB

Plugins installed

No response

Issue description

During the install of winter. The configuration, Database section has a combo box for Database Type defaulted to MySQL / MariaDB. When leaving the default selection MySQL / MariaDB it appears to default to SQLite and the install cannot pass the database test. Selecting a different choice in the combo box and then switching back to MySQL / MariaDB selection will pass the Final Checks and the install works.

Steps to replicate

Don't select Database Type. Enter Username, Password, Database Name. Go to Final Checks and the Database check will fail.

Workaround

Select SQLite in the combo box and then select MySQL / MariaDB. The Final Checks will now pass.

Any further details?

No response

bennothommo commented 3 years ago

@Domeman thanks for the report, but I cannot replicate this. The default database type is explicitly set to mysql (https://github.com/wintercms/web-installer/blob/main/src/Installer.vue#L82) so the only way it would be using sqlite is if the dropdown value were changed to sqlite.

Is there any other way to replicate this?

Domeman commented 3 years ago

Using windows 10, Laragon. If I do not select a database then the Final Check for database fails.

Domeman commented 3 years ago

watch: { 'site.database.type': { handler(newVal, oldVal) { const defaultPorts = { mysql: 3306, pgsql: 5432, sqlsrv: 1433, }; if (Number(this.site.database.port) === defaultPorts[oldVal] || oldVal === 'sqlite') { this.site.database.port = defaultPorts[newVal]; To me and I am no Vue expert is if I do not change the combo the OldVal will equal 'sqlite' shouldn' the oldVal be set to mysql ?

bennothommo commented 3 years ago

@Domeman that piece of functionality simply changes the port number if it's using a default port. That would have nothing to do with the selection of the database type beside being fired if the type changes.

bennothommo commented 3 years ago

Closing as it has been over a month since any activity on this occurred and we are trying to figure out what issues are still relevant. If this is still something that you would like to see through to fruition please respond and we can get the ball rolling.