? Success

User tests: Successful: Unsuccessful:

avatar richard67
richard67
5 Mar 2016

Summary of Changes

Currently the conversion to utf8mb4 or utf8 (because of changing standard do unicode sorting in collations) is executed on every run of the database schema fix, i.e. every time when in "Extensions -> Manage -> Database" the "Fix" button is clicked, regardless if there is anything shown to be fixed or not and regardless if the conversionalready has been preformed with success.

This PR changes that so the conversion is only run if the saved conversion status is not equal to what is expected according to the actual utf8mb4 support, which is also the condition to show the conversio to be done as a database problem, so if nothing shown nothing will be done, and if nothing to be done nothing shown.

Testing Instructions

Step 1: On a latest staging, edit file "administrator/components/com_installer/models/database.php" and go to the end of function "convertTablesToUtf8mb4". You will see following code as last statement in this function:

// Set flag in database if the update is done.
$db->setQuery('UPDATE ' . $db->quoteName('#__utf8_conversion')
. ' SET ' . $db->quoteName('converted') . ' = ' . $converted . ';')->execute();

Below this statement, means at the end of the function as last statement, add followng code:

JFactory::getApplication()->enqueueMessage('TEST', 'info');

Step 2: Go to "Extentions -> Manage -> Database". There should be no database problems shown.

Step 3: Click the "Fix" button.

Result: At the top an blue info box appears, showing the "TEST" message.

Step 4: Important: Close this info box (x button on top right corner of the message).

Repeat steps 3 and 4 a few times.

Result: Obviously function convertTablesToUtf8mb4 is performed with every click on the "Fix" button.

Step 5: Now apply this patch by replacing the file from edited in step 1 by the same file from this patch.

I am not sure if patchtester will correctly apply the patch after the editing in step 1, but you can try. Otherwise either undo the edit before using the patchtester, or exchange this 1 file "manually".

Step 6: Edit again the file edited in step 1, and again add this "TEST" message code line.

Step 7: Go again to "Extentions -> Manage -> Database", or if still there from previous test steps, refresh the page.

Step 8: Click the "Fix" button.

Result: The blue info message "TEST" does not appear.

Step 9: Execute following statement in sql for the tested database, e.g. in phpMyAdmin:

UPDATE #__utf8_conversion SET converted= 0;

(Replace "#__" by your db prefix.)

Step 10: Click the "Fix" button in "Extentions -> Manage -> Database".

Result: The blue info message "TEST" is shown at the top, i.e. if necessary the conversion is still performed with this patch.

At the end remove the hack for the "TEST" message if necessary from the restored file after reverting this patch.

avatar richard67 richard67 - open - 5 Mar 2016
avatar richard67 richard67 - change - 5 Mar 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2016
Labels Added: ?
avatar richard67 richard67 - change - 5 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 5 Mar 2016

Added testing instructions


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

avatar richard67 richard67 - change - 5 Mar 2016
The description was changed
avatar wilsonge wilsonge - change - 5 Mar 2016
Labels Added: ?
avatar richard67 richard67 - change - 6 Mar 2016
The description was changed
avatar richard67 richard67 - change - 6 Mar 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - test_item - 6 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

I have tested this item :white_check_mark: successfully on f450688

Works as described.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

@richard67 just a hint you can add markdown to prettify php/sql/javascript/etc code in github (see https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code)
Examples:

echo "php code";
JFactory::getApplication()->enqueueMessage('TEST', 'info');
UPDATE `#__utf8_conversion` SET `converted`= 0;
avatar richard67
richard67 - comment - 6 Mar 2016

@andrepereiradasilva Thanks for test and hint. Regarding markdown: Well, I am just too lazy for learning that. Maybe another day.

avatar Twincarb Twincarb - test_item - 6 Mar 2016 - Tested successfully
avatar Twincarb
Twincarb - comment - 6 Mar 2016

I have tested this item :white_check_mark: successfully on f450688


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

avatar richard67
richard67 - comment - 6 Mar 2016

Thanks for testing.

avatar wilsonge wilsonge - change - 6 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-06 20:37:25
Closed_By wilsonge
avatar wilsonge wilsonge - close - 6 Mar 2016
avatar wilsonge wilsonge - reference | a6d9536 - 6 Mar 16
avatar wilsonge wilsonge - merge - 6 Mar 2016
avatar wilsonge wilsonge - close - 6 Mar 2016
avatar wilsonge wilsonge - close - 6 Mar 2016
avatar wilsonge wilsonge - change - 6 Mar 2016
Milestone Added:
avatar wilsonge
wilsonge - comment - 6 Mar 2016

Merged

avatar richard67 richard67 - head_ref_deleted - 6 Mar 2016
avatar wilsonge wilsonge - change - 6 Mar 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment