? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
10 Jun 2020

Pull Request for Issue #29354 .

Summary of Changes

Since PR #28350 , the db_select option of the session variables for the database connection is not used anymore. But with thas PR it has been forgottento remove it from the parameters of the alternative database connection which is used for the attempt to create a new database when using the MySQL (PDO) or the PostgreSQL (PDO) database driver and the database doesn't exist and the user has privilege to create a database.

This causes a PHP notice "Undefined property: stdClass::$db_select in installation\src\Model\DatabaseModel.php on line 336" on PHP 7.4.

This Pull Request (PR) here solves that.

It is not an issue in J3.

Testing Instructions

Could be merged by review even.

But for real tests: Make a new installation with current 4.0-dev plus the patch of this PR applied. Try different scenarios:

  • Different database types "MySQL (PDO)" or "PostgreSQL (PDO)", whatever you have available, only "MySQLi" doesn't make sense because with this database type the issue doesn't happen.
  • Existing database with database user who has full privileges to only this database => installation succeeds.
  • Not existing database and user who has the privilege to create a new database, so that the installation can create it => installation succeeds.
  • Not existing database and user who doesn't have the privilege to create a new database => installation not started, error message shown.

Expected result

In no case there is any PHP notice "Undefined property: stdClass::$db_select in installation\src\Model\DatabaseModel.php on line 336".

Actual result

Under certain conditions (PHP version?) PHP notice "Undefined property: stdClass::$db_select in installation\src\Model\DatabaseModel.php on line 336".

Documentation Changes Required

None.

avatar richard67 richard67 - open - 10 Jun 2020
avatar richard67 richard67 - change - 10 Jun 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 10 Jun 2020
Category Installation
avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar SharkyKZ SharkyKZ - test_item - 10 Jun 2020 - Tested successfully
avatar SharkyKZ
SharkyKZ - comment - 10 Jun 2020

I have tested this item successfully on b135adb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/29556.

avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar richard67
richard67 - comment - 10 Jun 2020

@juliopontes Please test this Pull Request (PR). Just replace the changed file by the one of this PR, or you even can to the 2 small changes with an editor, or use patchtester if you have that. Then start a new installation. If it works, mark the test result in the issue tracker here https://issues.joomla.org/tracker/joomla-cms/29556 by using the "Test this" button, selecting the appropriate test result and then using the "Submit test result" button.

avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar richard67 richard67 - change - 10 Jun 2020
The description was changed
avatar richard67 richard67 - edited - 10 Jun 2020
avatar wilsonge
wilsonge - comment - 10 Jun 2020

So looks like before we preserved the value

// Disable autoselect database before it's created.
$tmpSelect = true;
if (isset($options['db_select']))
{
$tmpSelect = $options['db_select'];
}
$options['db_select'] = false;
- but I can't even see in J3 where you can actually set it 🤔

avatar wilsonge wilsonge - close - 10 Jun 2020
avatar wilsonge wilsonge - merge - 10 Jun 2020
avatar wilsonge wilsonge - change - 10 Jun 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-06-10 22:20:56
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 10 Jun 2020

Merging on review combined with the good test

avatar richard67
richard67 - comment - 10 Jun 2020

Thanks.

avatar richard67
richard67 - comment - 10 Jun 2020
  • but I can't even see in J3 where you can actually set it 🤔

Yes, strange.

Add a Comment

Login with GitHub to post a comment