? Success

User tests: Successful: Unsuccessful:

avatar richard67
richard67
7 Mar 2016

Pull Request for Issue #9331 , but not only for this.

Summary of Changes

This PR makes libraries/cms/installer/installer.php handle correctly comment lines and query downgrade from utf8mb4 to utf8 in sql statements read from schema update files or other sql files.

Because the database driver in use may still be the old one, it has local implementations of functions for this purpose, same as it was done by @wilsonge in his PR #9297 for administrator/components/com_admin/script.php.

This PR does not solve the problem that after update with Extension Installer, the utf8(mb4) conversion is not done and has to be done using the database "Fix" button.

Testing Instructions

Update to Beta 5 using one of the following custom URLs for the Joomla! Update component, depending on the version to be updated:

After successful update, check in log/joomla_update.php the log entry containing the text "update Ran query from file 3.5.0-2016-02-26". It shows the start of an sql statement beginning with comment lines as follows:

Query text: -- -- Create a table for UTF-8 Multibyte (utf8mb4) conversion for MySQL in -- or.

Now check "Extensions -> Manage -> Database". It should look as follows:

Database table structure is up to date.

Database schema version (in #__schemas): 3.5.0-2016-03-01.
Update version (in #__extensions): 3.5.0-beta5.
Database driver: mysqli.
93 database changes were checked successfully.
145 database changes did not alter table structure and were skipped.

In case of a MySQL database server not supporting utf8mb4, no SQL error message about invalid character set was shown.

Now repeat the same procedure with following custom URLs for updating to Beta 5 + this PR with Joomla! Update component:

Result:

The logged sql query start with text "Ran query from file 3.5.0-2016-02-26" looks now like following, comment lines have been removed

Query text: CREATE TABLE IF NOT EXISTS #__utf8_conversion ( converted tinyint(4) NOT N.

Database structure is up do date as shown for test with unpatched Beta 5.

In case of a MySQL database server not supporting utf8mb4, no SQL error message about invalid character set was shown.

Now test update to Beta 5 + this PR using the Extension installer.

The patched package you can find here: http://test5.richard-fath.de/Joomla_3.5.0-beta5-Beta-Update_Package_test1.zip

After successful update, go to "Extensions -> Manage -> Database".

Result:

The utf8mb4 or utf8 conversion is shown as to be done.

Use the "Fix" button to perform the conversion.

Result:

Database is up to date as shown above for the tests before.

Hint on utf8mb4 support: It is NOT supported, if

database server version is lower than 5.5.3,

or if mysqlnd client, this has a version lower than 5.0.9,

or other database client has version lower than 5.5.3.

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

I have tested this item :white_check_mark: successfully on e05c153

Update method: Joomla Update Component

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: Upgrade success, all tables converted to utf8mb4_unicode_ci

Upgrade path: 3.2.7 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: Upgrade success. all tables converted to utf8mb4_unicode_ci

Upgrade path: 3.4.8 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: Upgrade success, all tables converted to utf8mb4_unicode_ci

Note: in the 3.2.7 upgrade got a blank page after upgrade instead of the login panel, but login again and everything worked. The blank page seems not to be related to this PR.


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

avatar andrepereiradasilva andrepereiradasilva - test_item - 7 Mar 2016 - Tested successfully
avatar richard67 richard67 - change - 7 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 7 Mar 2016

Added test for Extension Installer method with patched Beta 5 to testing instructions.


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

avatar richard67 richard67 - change - 7 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva Can you test Extension Installer method, too? I just have updated the testing instructions.

Look for bold text before the end to find the new test.

Let me know please if you get some SQL error or internal server error or not.


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

avatar richard67 richard67 - change - 7 Mar 2016
The description was changed
avatar richard67
richard67 - comment - 7 Mar 2016

Corrected typo "Fux" button -> "Fix" button


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

Update method: Extensions -> install from URL (your patched URL)

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: 500 error, no tables converted (no utf8 table).

Upgrade path: 3.2.7 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: 500 error, no tables converted (no utf8 table).

Upgrade path: 3.4.8 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: Upgrade success, but no tables converted (converted = 0).

Please note: when i made a patch zip with just the sql comment corrected it worked.
@richard67 Can you make a package of your patched version + the sql comments space corrected?

avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva What means "the sql comments space corrected"? Means remove all comments from the sql file? Or just some spaces in the comments "-- " -> "--"?

The result as for 3.4.8 is expected up to now - it seems the package installer uses the old script.php.

avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva Or maybe you can make a PR to my repo and branch for this PR with your changes in the SQL script?

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

this line https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_admin/sql/updates/mysql/3.4.0-2014-09-16.sql#L6 needs a space after --

--ALTER TABLE #__redirect_links MODIFY new_url varchar(255);
should be
-- ALTER TABLE #__redirect_links MODIFY new_url varchar(255);

the same think applies to the other sql for the other databases i think

avatar richard67
richard67 - comment - 7 Mar 2016

ahhh these ... yes!!! I was in the other sql file in mind :smile: I add this to my pr and update my zip, stay tuned until i report here done.

avatar richard67
richard67 - comment - 7 Mar 2016

Ahh or I modify the regex to not expect a space there after the "--".

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

or the two things ....

avatar richard67
richard67 - comment - 7 Mar 2016

Hmm is not a regex and should do it right already ... I change the sql as you suggested, for fast solution.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

is the zip ready?
(don't forget to commit the changes to the PR)

avatar joomla-cms-bot
joomla-cms-bot - comment - 7 Mar 2016

This PR has received new commits.

CC: @andrepereiradasilva


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

avatar richard67
richard67 - comment - 7 Mar 2016

Zip is ready, same URLs. Just committed changes to here, too.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

Update method: Extensions -> install from upload (your patched zip)

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)

Result:

  • Upgrade success.
  • No tables converted. Only #__utf8_conversion in utf8mb4_unicode_ci (converted = 0).
  • Pressed Fix, All tables in utf8mb4_unicode_ci (converted = 2).
Upgrade path: 3.2.7 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)

Result:

  • Upgrade success (blank page - see note).
  • No tables converted. Only #__utf8_conversion in utf8mb4_unicode_ci (converted = 0).
  • Pressed Fix, All tables in utf8mb4_unicode_ci (converted = 2).

Note: in the 3.2.7 upgrade got a blank page after upgrade instead of the login panel, but login again and everything worked. The blank page seems not to be related to this PR.

Upgrade path: 3.4.8 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)

Result:

  • Upgrade success.
  • No tables converted. Only #__utf8_conversion in utf8mb4_unicode_ci (converted = 0).
  • Pressed Fix, All tables in utf8mb4_unicode_ci (converted = 2).
avatar richard67 richard67 - change - 7 Mar 2016
The description was changed
avatar andrepereiradasilva andrepereiradasilva - test_item - 7 Mar 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

I have tested this item :white_check_mark: successfully on 42e6bcd

As results above.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

so the 500 error has really the missing space in the sql comments!!

avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva This is the expected result for the Extension Installer method, so your test result is still good.

Thanks for testing.

c.c. @wilsonge For the long term we should keep this in mind and see why the "--" comments caused a server error 500 and the "-- " comments do not.

And the still open point to be solved with another PR if necessary is that after update with Extension Installer, the conversion has to be done with the "Fix" button. Can it be because the old "script.php" is loaded?


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

avatar richard67
richard67 - comment - 7 Mar 2016

More testers please!!! This should go into 3.5.0 RC.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

BTW, meanwhile discovered why the 3.2.7 was returning blank page after update.
Just to inform if this problem happens to anyone else.

If seems in PHP 5.6.x the iconv_set_encoding function throws a deprecated notice (http://php.net/manual/en/function.iconv-set-encoding.php), and because of that was generating some errors in the error log and returned a blank page after update.

PHP message: PHP Deprecated:  iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in /path/to/joomla-327/libraries/joomla/string/string.php on line 27
PHP message: PHP Deprecated:  iconv_set_encoding(): Use of iconv.input_encoding is deprecated in /path/to/joomla-327/libraries/joomla/string/string.php on line 28
PHP message: PHP Deprecated:  iconv_set_encoding(): Use of iconv.output_encoding is deprecated in /path/to/joomla-327/libraries/joomla/string/string.php on line 29

Just by removing the deprecated log from php configuration: error_reporting = E_ALL & ~E_DEPRECATED and restarting php, the 3.2.7 update worked fine also.

avatar mbabker
mbabker - comment - 7 Mar 2016

Ya, 3.3.4 was the first release fully tested with PHP 5.6 (including dealing with those deprecations); 2.5.28 also got the needed patch before that last release. So that'd be something to keep in mind.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

So in theory: update from 3.0.x to 3.3.3 to higher versions in PHP 5.6 = blank page if PHP deprecated log active?

avatar mbabker
mbabker - comment - 7 Mar 2016

Good possibility if the log messages are being echoed out. If you've got a combo where you have E_DEPRECATED being logged but display_errors off (truthfully I don't even think you can do that with Joomla because of the stuff run in the app bootstraps) it could work.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

My blank page scenario in 3.2.7 upgrade (php-fpm configuration)

php_admin_value[log_errors]         = on
php_value[error_reporting]          = E_ALL
php_value[display_errors]           = off

Joomla error reporting: System default

My upgrade success scenario in 3.2.7 upgrade (php-fpm configuration)

php_admin_value[log_errors]         = on
php_value[error_reporting]          = E_ALL & ~E_DEPRECATED
php_value[display_errors]           = off

Joomla error reporting: System default

In other words the errors were not being echoed out

either way the upgrade was successfully in both cases, just got a blank page in first scenario.

avatar mbabker
mbabker - comment - 7 Mar 2016

Like I said, Joomla changes some stuff during the bootstrap process...

https://github.com/joomla/joomla-cms/blob/3.2.7/administrator/includes/framework.php#L51

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

ok i see.

Well don't want to hijack this PR more with this, just wanted to post that information here for anyone with the same problem.

avatar richard67
richard67 - comment - 7 Mar 2016

More testers please!!!

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

maybe adding the golden shiny 3.5.0 blocker label will help ;)

avatar richard67
richard67 - comment - 7 Mar 2016

Can I add it myself?

avatar brianteeman brianteeman - change - 7 Mar 2016
Labels Added: ?
avatar brianteeman
brianteeman - comment - 7 Mar 2016

Done

avatar brianteeman brianteeman - change - 7 Mar 2016
Category Installation SQL
avatar brianteeman brianteeman - change - 7 Mar 2016
Labels
avatar anibalsanchez anibalsanchez - test_item - 8 Mar 2016 - Tested successfully
avatar anibalsanchez
anibalsanchez - comment - 8 Mar 2016

I have tested this item :white_check_mark: successfully on 42e6bcd

Test OK

Some test notes:

Joomla_3.5.0-beta5-Beta-Update_Package.zip

  • In the initial test, I have manually downloaded and updated to Joomla_3.5.0-beta5-Beta-Update_Package.zip
  • In the log/joomla_update.php

    #
    #<?php die('Forbidden.'); ?>
    #Date: 2016-03-08 18:36:05 UTC
    #Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

    #Fields: datetime priority clientip category message
    2016-03-08T18:36:05+00:00 INFO 127.0.0.1 update COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES

  • In Extensions -> Manage -> Database

    Warning: Database is not up to date!

    The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4).

  • Fix, and it worked OK

Joomla_3.5.0-beta5-Beta-Update_Package_test1.zip

  • In the log/joomla_update.php

    #
    #<?php die('Forbidden.'); ?>
    #Date: 2016-03-08 18:55:16 UTC
    #Software: Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

    #Fields: datetime priority clientip category message
    2016-03-08T18:55:16+00:00 INFO 127.0.0.1 update COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES

  • In Extensions -> Manage -> Database

    Database table structure is up to date.

    Other Information

    Database schema version (in #__schemas): 3.5.0-2016-03-01.
    Update version (in #__extensions): 3.5.0-beta5.
    Database driver: mysqli.
    93 database changes were checked successfully.
    145 database changes did not alter table structure and were skipped.


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

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

I have tested this item :white_check_mark: successfully on 42e6bcd

@richard67 I have just completed a series of tests as per your instructions with mixed results, because I only got good results when using your packages I am marking this as Successful

Update method: Joomla Update Component

Upgrade path: 2.5.28 (clean with sample data) -> 2.5.x to 3.5.0-beta5: https://downloads.joomla.org/updates/cms/test/list_test_25to3x.xml
Result: Fail: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--ALTER TABLE #__redirect_links MODIFY new_url varchar(255)' at line 5 SQL=-- -- The following statement has to be disabled because it conflicts with -- a later change added with Joomla! 3.5.0 for long URLs in this table -- --ALTER TABLE #__redirect_links MODIFY new_url varchar(255);
With multiple 500 errors across many pages, both in the front and back end. Database tables all utf8_general_ci

I performed this test twice and I had the same result both times.

Upgrade path: 3.4.8 (clean with sample data) -> 3.x to 3.5.0-beta5: https://downloads.joomla.org/updates/cms/test/list_test.xml
Result: Upgrade success. all tables converted to utf8mb4_unicode_ci

Upgrade path: 2.5.28 (clean with sample data) -> 2.5.x to 3.5.0-beta5 + this PR: http://test5.richard-fath.de/list_test1_j25.xml
Result: Upgrade success, all tables converted to utf8mb4_unicode_ci

Update method: Extensions -> install from URL

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 5 Update package http://test5.richard-fath.de/Joomla_3.5.0-beta5-Beta-Update_Package_test1.zip

Result: Upgrade partial Success, The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4). Clicking Fix solves the issue leading to Upgrade Success.

Upgrade path: 3.4.8 (clean with sample data) -> 3.5.0 beta 5 Update package (your patched version)
Result: Upgrade partial Success, The Joomla! Core database tables have not been converted yet to UTF-8 Multibyte (utf8mb4). Clicking Fix solves the issue leading to Upgrade Success.


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

avatar grhcj grhcj - test_item - 8 Mar 2016 - Tested successfully
avatar grhcj
grhcj - comment - 8 Mar 2016

I have tested this item :white_check_mark: successfully on 42e6bcd

Tested only for joomla update component (both URLs).


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 8 Mar 2016

So all tests as expected @richard67 right? RTC?

avatar richard67
richard67 - comment - 8 Mar 2016

Yes, even if I am not happy with my solution, is a kind of hack. But it works for now. Later the database driver's splitSql function has to be improved regarding comment handling. May @wilsonge or other maintainer reject it if he thinks my solution is bad.

avatar andrepereiradasilva
andrepereiradasilva - comment - 8 Mar 2016

... at least the part that resolves the 500 error is very important!

avatar wilsonge wilsonge - change - 9 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-09 01:03:04
Closed_By wilsonge
avatar wilsonge wilsonge - close - 9 Mar 2016
avatar wilsonge wilsonge - close - 9 Mar 2016
avatar wilsonge wilsonge - reference | fa0d3da - 9 Mar 16
avatar wilsonge wilsonge - merge - 9 Mar 2016
avatar wilsonge wilsonge - close - 9 Mar 2016
avatar wilsonge wilsonge - change - 9 Mar 2016
Milestone Added:
avatar wilsonge wilsonge - change - 9 Mar 2016
Labels Removed: ?
avatar wilsonge
wilsonge - comment - 9 Mar 2016

I don't like it - but what needs to be done....

avatar richard67 richard67 - head_ref_deleted - 9 Mar 2016
avatar Kubik-Rubik
Kubik-Rubik - comment - 9 Mar 2016

Yeah, better this solution than no solution! Thanks @richard67. :+1:

Add a Comment

Login with GitHub to post a comment