User tests: Successful: Unsuccessful:
Pull Request for Issue #27924 .
Depending on the particular database driver, exception texts in error messages are more or less meaningful. This PR doesn't change that.
Step 1: Start a new installation of a current 4.0-dev without the patch of this PR applied.
Step 2: When coming to the database information, enter a valid server and a valid user name and password for a user who doesn't have the privilege to create databases. Enter a database name for which no database exists. When having filled out all fields, use the "Install Joomla >" button to start the installation.
Result: Depending on the particular database driver you see a more or less meaningful error message.
Step 3: Correct the database name so it fits to an existing database for which the previously entered user has all privileges required for a Joomla installation. Then use the "Install Joomla >" button again.
Result: See issue #27924 and section "Actual result" below.
Step 4: Delete configuration.php, and either delete the session cookies in your browser settings or close wour browser window and open it again.
Step 5: Apply the patch of this PR.
Step 6: Start a new installation of a current 4.0-dev with the patch of this PR applied.
Step 7: Repeat steps 2 and 3 above.
Result: Installation continues with the corrected database name, see section "Expected result" below.
Step 8: Delete again configuration.php, and again either delete the session cookies in your browser settings or close wour browser window and open it again.
Step 9: Start again a new installation of a current 4.0-dev with the patch of this PR applied.
Step 10: When coming to the database information, test that the version checks introduced with PR #28135 still work, i.e. either use a databas server which doesn't fulfill the minimum version requirement by either the database driver or the CMS, or patch either the database driver's or the CMS' requirement so it isn't fulfilled by your database server.
The CMS's requirements for the particular database types can be found and if necessary patched here:
joomla-cms/installation/src/Helper/DatabaseHelper.php
Lines 23 to 48 in c90cbb5
Result: The check for the minimum required database server version still works for any kind of database. If the requirement is not fulfilled, it is possible to change to another database which fulfills the requirement (or patch the requirement) and continue with the installation.
The next test steps 11 to 13 currently only work (with or without this PR) for MySQLi and MySQL (PDO) but not for PostgreSQL (PDO). I have no idea how it is with MariaDB. PostgreSQL users please skip this test and count is as successful. I will fix installation of new database for PostgreSQL with a later PR.
Step 11: Delete again configuration.php, and again either delete the session cookies in your browser settings or close wour browser window and open it again.
Step 12: Start again a new installation of a current 4.0-dev with the patch of this PR applied.
Step 13: When coming to the database information, enter a valid server and a valid user name and password for a user who has the privilege to create databases, e.g. "root" on MySQL. Enter a database name for which no database exists. When having filled out all fields, use the "Install Joomla >" button to start the installation.
Result: Creating the database works as well as before for MySQLi and MySQL (PDO).
When entering a not existing database as database name in the installation form and a user who doesn't have the permission to create a database, you can correct database or user information after the error message and then continue with the installation.
When entering a not existing database as database name in the installation form and a user who doesn't have the permission to create a database, and then after the error message correct database or user information and start the installation again, it stops with an unspecified database error, see issue #27924 .
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Installation |
Labels |
Added:
?
|
Title |
|
Title |
|
Title |
|
(FYI for those of us that follow the tracker by email - we only get the first post and not the edited post)
Please wait a bit with testing .. have to fix the case for new db creation for MySQL (PDO).
Update: Fixed. Ready for tests.
Labels |
Added:
?
|
(FYI for those of us that follow the tracker by email - we only get the first post and not the edited post)
@brianteeman What are you refering to? Did I do something wrong?
PR is ready for tests.
Don't kill me. But can we keep the model throw exceptions and convert to the exception enqueueMessage in the controller with a standard try/catch? Just keep options open for install Joomla from CLI in the future where we're going to want to have exceptions converted to a different sort of output in 4.x versions.
At a quick look - Yes probably
Isn’t there another way? Like it is now (without my PR) it is definitely not working either.
All I'm saying is throw the exception in the model (like now) but then change is catch the exception here https://github.com/joomla/joomla-cms/blob/staging/installation/controller/database.php#L52
Then in the catch use $app->sendJsonResponse($e);
Closing as this PR is correct and solves the issues but goes into a wrong direction, see @wilsonge 's comment above.
Will reopen the issue as long as I don't have a new PR.
Will try to make a new one but it may take some days until I find time, very likely weekend.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-09 18:20:06 |
Closed_By | ⇒ | richard67 |
@Oemand Please test.