-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Issue 26929 regression: Unique alias & Unicode alias issue #8374
Description
To test:
- Begin by performing a clean install of Joomla! 3.4.5 on a server with a version of mysql that supports utf8mb4 (necessary because of utf8mb4 database errors #8267). Also install the "Test English (GB) Sample Data".
- Next, update the installation to 3.5.0-beta.
- Follow the original test instructions for issue 26929.
As was the case then, an error occurs:
Warning
Save failed with the following error: Another menu item with the same parent has this alias (remember it may be a trashed item).
Note that this issue does not occur if starting with a clean install of 3.5.0-beta. It only occurs when updating from a previous version.
A different test:
- Perform a clean install of 3.4.5 (as above).
- Follow the original test instructions for issue 26929 (while still on v. 3.4.5). The test passes.
- Attempt to upgrade to 3.5.0-beta.
Note the error:
Warning
Duplicate entry '0-1-presentation-*' for key 'idx_client_id_parent_id_alias_language' SQL=ALTER TABLE `fyu2o_menu` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Look at Extensions->Database. Note the errors:
3 Database Problems Found.
Database schema version (3.4.0-2015-02-26) does not match CMS version (3.5.0-2015-11-05).
Table 'fyu2o_contentitem_tag_map' should not have index 'idx_tag'. (From file 3.5.0-2015-10-26.sql.)
Table 'fyu2o_contentitem_tag_map' should not have index 'idx_type'. (From file 3.5.0-2015-10-26.sql.)
Tap the Fix button. Note the error (Incidentally, this error is not directly related to this issue. It's present on any update from 3.4.5 to 3.5 when using mysql. Nonetheless, it originates from the same conversion to utf8mb4 discussed below. It, however, is not fixed by the suggested fix further below. I guess it should be entered as another issue.):
1 Database Problem Found.
Table 'fyu2o_user_profiles' does not have column 'profile_value' with type 'TEXT'. (From file 3.3.4-2014-08-03.sql.)
Tap the Fix button again. No more errors shown. The database's structure is now fixed. But its data is damaged: plugin extension ID 453 is missing; it should have been added by administrator/components/com_admin/sql/updates/mysql/3.5.0-2015-10-13.sql.
The underlying cause of the regression is in administrator/components/com_admin/sql/updates/mysql/3.5.0-2015-07-01.sql (originating from #7173). On updating to 3.5.0, lines 13-20 convert tables to utf8mb4_general_ci collation. (Note that using utf8_general_ci was the original fix for issue 26929.) But once the columns are converted to utf8mb4_bin collation, their tables are converted to utf8mb4_general_ci collation later on in the file. For example:
ALTER TABLE `#__banners` MODIFY `alias` varchar(191) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT '';
is followed with:
ALTER TABLE `#__banners` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
This resets the collation of column alias back to utf8mb4_general_ci.
Reordering the SQL statements should fix the immediate problem.