Skip to content

Commit

Permalink
Fix missing utf8mb4 conversions since 3.9.17
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 committed May 11, 2020
1 parent 3687dba commit 7f1c03b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2464,11 +2464,17 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
{
$convertedStep1 = 2;
$convertedStep2 = 4;

// The first step has to be repeated if it has not been run (converted = 4 in database)
$convertedRequired = 5;
}
else
{
$convertedStep1 = 1;
$convertedStep2 = 3;

// All done after step 2
$convertedRequired = 3;
}

// Check conversion status in database
Expand All @@ -2495,7 +2501,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
}

// Nothing to do, saved conversion status from DB is equal to required final status
if ($convertedDB == $convertedStep2)
if ($convertedDB == $convertedRequired)
{
return;
}
Expand All @@ -2504,7 +2510,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
$hasErrors = false;

// Steps 1 and 2: Convert core tables if necessary and not to be done at later steps
if ($convertedDB < $convertedStep1)
if ($convertedDB < $convertedStep1 || ($convertedRequired == 5 && ($convertedDB == 3 || $convertedDB == 4)))
{
// Step 1: Drop indexes later to be added again with column lengths limitations at step 2
$fileName1 = JPATH_ROOT . '/administrator/components/com_admin/sql/others/mysql/utf8mb4-conversion-01.sql';
Expand Down Expand Up @@ -2594,7 +2600,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)

if (!$hasErrors)
{
$converted = $convertedStep2;
$converted = $convertedRequired;
}
}

Expand Down

0 comments on commit 7f1c03b

Please sign in to comment.