?
avatar Denitz
Denitz
30 Jul 2020

Steps to reproduce the issue

Setup the env with not converted tables.

Expected result

Installer > database > fix performs conversion if fixing "Joomla CMS"

Actual result

No conversion.

Additional comments

See Joomla\Component\Installer\Administrator\Model::fix():

			if ($i === 'com_admin')
			{
				$installer = new \JoomlaInstallerScript;
				$installer->deleteUnexistingFiles();
				$this->fixDefaultTextFilters();

				/*
				 * Finally, if the schema updates succeeded, make sure the database table is
				 * converted to utf8mb4 or, if not supported by the server, compatible to it.
				 */
				$statusArray = $changeSet['changeset']->getStatus();

				if (count($statusArray['error']) == 0)
				{
					$installer->convertTablesToUtf8mb4(false);
				}
			}

Conversion is checked for com_admin $i which is an extension_id and is always numeric.

There is another issue with #__ucm_history renamed to #__history but #__ucm_history is still presented in utf8mb4 conversion SQL, hence conversion is never finished.

avatar Denitz Denitz - open - 30 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 30 Jul 2020
avatar richard67
richard67 - comment - 30 Jul 2020

Conversion is checked for com_admin $i which is an extension_id and is always numeric.

Confirmed. It seems that PR #17537 which introduced database fix for expensions has not really been tested regarding the utf8mb4 conversion.

Will see if I can fix that or find someone who can.

There is another issue with #__ucm_history renamed to #__history but #__ucm_history is still presented in utf8mb4 conversion SQL, hence conversion is never finished.

See issue #30224 . Fix is on the way.

avatar richard67
richard67 - comment - 30 Jul 2020

@Denitz You have discovered a double bug ;-)

  1. The $i used in the comparison is not the extension ID, it is the index in the array, i.e. 0for the first extension. The extension id is the value $cid.
  2. As you correctly mentioned, it makes not much sense to compare the extension ID with a string 'com_admin'.
avatar Denitz
Denitz - comment - 30 Jul 2020

@richard67 Argh, yes, $i is even worse, good catch!

I also guess Joomla\CMS\Schema\ChangeSet::__construct should have phpDoc DatabaseInterface for $db but not DatabaseDriver, we have inspection error:

Expected parameter of type '\Joomla\Database\DatabaseDriver', '\Joomla\Database\DatabaseInterface' provided

avatar richard67
richard67 - comment - 30 Jul 2020

That's another issue.

avatar richard67
richard67 - comment - 30 Jul 2020

PR #30233 for the main issue here is almost ready, only testing instructions are missing. Am working on it later.

avatar richard67
richard67 - comment - 30 Jul 2020

Closing as having a pull request. Please test #30233

avatar richard67 richard67 - close - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-30 11:02:10
Closed_By richard67

Add a Comment

Login with GitHub to post a comment