[4.0] [Installation] Fix error when specifying a not existing database and not having privilege to create a new one#28345
Merged
wilsonge merged 4 commits intojoomla:4.0-devfrom Mar 17, 2020
Conversation
In configuration model, delete configuration file in case of exceptions and re throw, in controller enqueue exception message in that case.
Member
Author
|
Added release blocker label as inherited from issue #27924 . |
wilsonge
approved these changes
Mar 14, 2020
Member
Author
|
Thanks @wilsonge . |
Member
|
I have tested this item ✅ successfully on e47670e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28345. |
Contributor
|
I have tested this item ✅ successfully on e47670e This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28345. |
Contributor
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28345. |
Contributor
|
Thanks! |
Member
Author
|
Thanks, too. |
This was referenced Mar 18, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue #27924 .
Summary of Changes
This PR adds handling of exceptions which are thrown by the installation's database model in routine createDatabase but never were caught and handled so that e.g. the bad connfiguration file after a bad attemt to create the database was not deleted.
Testing Instructions
Requirements
Instructions
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, or alternatively change user to one who has the privilege to create a new database. Then use the "Install Joomla >" button again.
Result: For MySQLi and MySQL (PDO): See section "Actual result" below. For PostgreSQL (PDO). it might be like described in section "Expected result".
Step 4: Repeat steps 1 to 3 but this time with the patch of thos PR applied.
Result: See section "Expected result" below.
Expected result
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 by using again the "Install Joomla >" button.
Actual result
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, at least when using MySQLi or MySQL (PDO). For PostgreSQL the error could not be reproduced before..

Documentation Changes Required
None.