? ? Pending

User tests: Successful: Unsuccessful:

avatar richard67
richard67
30 Jul 2020

Pull Request for Issue #30224 .

This pull request is not relevant for installations with a PostgreSQL database. It only applies to MySQL (or MariaDB).

Summary of Changes

With Pull Request (PR) #29217 , the #__ucm_history database table has been renamed to #__history.

But it was forgotten to do this change in the utf8mb4 conversion SQL script.

This causes an update from 3.10 to 4 with utf8mb4 conversion to fail with an SQL error.

This PR here corrects this.

Due to the minimum database server version requirement we can be sure that J4 runs on a database which supports utf8mb4.

But the utf8mb4 conversion is still needed in J4 for following scenario:

  1. Just after the update to version 3.10, the dabase is migrated to the new server which supports utf8mb4, or updated to a newer version, so the conversion could not be triggered by the update to 3.10.
  2. The database checker would show that the utf8mb4 conversion needs to be done, and with using the "Fix" button it should be run, but the admin simply doesn't check for database error and immediately updates to J4.
  3. So the database changes for J4 are done during the update, but the database tables still are utf8 without mb4.
  4. That's why we have to run the utf8mb4 conversion once at the end when updating to J4.

Testing Instructions

Preparation

On a clean installation of Joomla 3.10 (latest nightly or Alpha 1 or current 3.10-dev branch) using a MySQL or MariaDB database, login to database using a tool like e.g. phpMyAdmin, and issue following SQL statement, replacing #__ by your database table prefix:

UPDATE `#__utf8_conversion` SET `converted`=3;

This will simulate the situation that a database server of a J 3.10 has been updated from an old version which did not support utf8mb4 to a newer version which does that and fulfills the version requirements of J4, or migrates the database from an old server to a new server with the same result.

Go to Global Configuration and set error reporting to "Maximum" in the server settings.

Go to "Extensions -> Manage -> Database" and check if there are database problems, but DO NOT USE THE FIX BUTTON!!!

Result: 1 database problem "The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4).".
j4-pr-30227_preparation

Make a complete backup, i.e. files and database, so you can later restore the starting point for test 2 after having done test 1.

Test 1: Reproduce the issue

Update a Joomla 3.10 which has been prepared as described above in section "Preparation" to the latest Joomla 4 nightly build.

If you can use the Live Update, change the update Channel to "Custom URL" and enter the following URL in the Joomla Update component's options: https://update.joomla.org/core/nightlies/next_major_list.xml.

I you can't use the Live Update for some reason, download the update package from the following link and use "Upload & Update": https://developer.joomla.org/nightlies/Joomla_4.0.0-beta4-dev-Development-Update_Package.zip.

Hint: The error alert "The template for this display is not available." shown during the update when having to log in is a know issue and can be ignored.

Result: See section "Actual result BEFORE applying this Pull Request" below.

Test 2: Test the fix of this PR

Same as before, but this time you update the prepared 3.10 to latest 4.0-dev plus the patch of this PR applied.

For this you either use the Live Update with custom URL https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/30227/downloads/34309/pr_list.xml, or use the "Upload & Update" and download the update package for this PR from https://ci.joomla.org/artifacts/joomla/joomla-cms/4.0-dev/30227/downloads/34309/Joomla_4.0.0-beta4-dev+pr.30227-Development-Update_Package.zip.

Use a tool like e.g. phpMyAdmin to check collation of core database tables.

Result: See section "Expected result AFTER applying this Pull Request" below.

Actual result BEFORE applying this Pull Request

The update fails with an SQL error about not existing table #__ucm_history (replace #__by your database prefix). See issue #30224 .
j4-pr-30227_error

In "System -> Information -> Database" (which was "Extensions -> Manage -> Database" in J3):
j4-pr-30227_error-2

Using the "Update Structure" button (formerly called "Fix" in J3) does not change anything.

Expected result AFTER applying this Pull Request

The update ends with success.
j4-pr-30227_ok

The error alert "The template for this display is not available." is a know issue and can be ignored. It will disappear and never appear again after first navigating in the backend.

In "System -> Information -> Database" (which was "Extensions -> Manage -> Database" in J3):
j4-pr-30227_ok-2

The error about not matching version numbers is normal when using an update package which has been automatically build for a PR. It can be ignored, but it also can be fixed with the "Update Structure" button because that looks nicer at the end.

In database all core tables have collation utf8mb4_unicode_ci.

Documentation Changes Required

None.

avatar richard67 richard67 - open - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Jul 2020
Category Administration com_admin
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
Title
[4.0] Fix wrong table name "#__ucm_history" in utf8mb4 conversion sql
[4.0] Fix wrong table name "#__ucm_history" in utf8mb4 conversion SQL script
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar richard67 richard67 - change - 30 Jul 2020
The description was changed
avatar richard67 richard67 - edited - 30 Jul 2020
avatar Denitz Denitz - test_item - 30 Jul 2020 - Tested successfully
avatar Denitz
Denitz - comment - 30 Jul 2020

I have tested this item successfully on 9712037


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

avatar Quy Quy - test_item - 30 Jul 2020 - Tested successfully
avatar Quy
Quy - comment - 30 Jul 2020

I have tested this item successfully on 9712037


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

avatar Quy Quy - change - 30 Jul 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 30 Jul 2020

RTC


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

avatar richard67
richard67 - comment - 30 Jul 2020

Thanks guys for testing.

avatar Quy Quy - close - 1 Aug 2020
avatar Quy Quy - merge - 1 Aug 2020
avatar Quy Quy - change - 1 Aug 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-08-01 23:59:17
Closed_By Quy
Labels Added: ? ?

Add a Comment

Login with GitHub to post a comment