? ? Pending

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
3 Mar 2016

Summary of Changes

Adds the utf8mb4 conversion in the Joomla Update process (and also incidentally extension manager update)

Testing Instructions

Attempt to upgrade from Joomla 3.4.8 to this package [http://gwilson.org/Joomla_3.5.0-beta3-Beta-Update_Package.zip] through either Joomla Update (by setting the update stream to testing and the zip in your tmp folder (alternatively if you are hitting the SSL Certificate Error set the update stream to custom with the following URL: http://gwilson.org/list_test_pr9297.xml ), or the extension manager (by installing it like any regular extension). The Utf8Mb4 conversion should now take place automatically without you needing to use the database fixer tool.

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

Let me know when you are ready for testing, I have both kinds of databases, i.e. with and without utf8mb4 support. Btw, if you find time ... there is still one easy test I need for my other PR.

avatar wilsonge
wilsonge - comment - 3 Mar 2016

I'm not going to have time tonight (been working on this and talking to marketing for 3.5) but I have cloned it onto my laptop for the train ride in tomorrow :) Generating and doing some testing of the demo package now :)

avatar richard67
richard67 - comment - 3 Mar 2016

Another thing I saw in your test description: I think you mean update stream "Custom URL", not "Testing", right?

avatar richard67
richard67 - comment - 3 Mar 2016

Ah, and this works? Good to know.

avatar wilsonge
wilsonge - comment - 3 Mar 2016

well theoretically - i've never tried it before so it could be a disastrous failure :P

avatar richard67
richard67 - comment - 3 Mar 2016

Ok, have a good working now, and sorry for disturbing. Am available for testing tomorrow.

avatar wilsonge
wilsonge - comment - 3 Mar 2016

No it's fine - thanks for picking up on that mistake :)

avatar wilsonge
wilsonge - comment - 4 Mar 2016

I think I'm going to loose the will to live soon. Tonight is one of those nights where I got as far as tagging a beta4 (locally) and going through the full release strategy on my pc and extension manager tells me it's invalid -.-

avatar wilsonge
wilsonge - comment - 4 Mar 2016

I'm not sure if this is going to work or not - but let's try opening this to the floor for testing :/

avatar infograf768
infograf768 - comment - 4 Mar 2016

Trying to install using "testing" and http://gwilson.org/Joomla_3.5.0-beta3-Beta-Update_Package.zip just does not work here. I have a lot of errors. Too many to list here.

Therefore I tried using Extension Installer:
I get:
screen shot 2016-03-04 at 08 34 14

Then going to Database, I get:
screen shot 2016-03-04 at 08 35 11

I had to use the Fix button to solve the remaining issue.
I guess therefore that my test is unsuccessful.

avatar Bodge-IT
Bodge-IT - comment - 4 Mar 2016

Tried to update using the Joomla Updater, put beta3 into tmp folder, set update to testing.
Update failed.
joomla-beta3-test

Not sure if the updater is trying to use the file in TMP, doesn't look like it?

avatar Bodge-IT
Bodge-IT - comment - 4 Mar 2016

Tried the extension route. Got an SQL error same as @infograf768 and same error in database ui.

System did update but it decided to update to beta4, not beta3...frisky updater!
Database encoding looks the same as before.

avatar richard67
richard67 - comment - 4 Mar 2016

@wilsonge Sorry, did not read your skype last night. the answer to your question is related to what JM had, the empty SQL error at the top. We have to trim the SQL after having removed comments becuase otherwise query is not detected to be empty (space only) and is executed.

avatar Bodge-IT
Bodge-IT - comment - 4 Mar 2016

Let me know when fixed, I'm ready to go again.

avatar richard67
richard67 - comment - 4 Mar 2016

@wilsonge I've meanwhile answered your question on skype. I will later test this too and see what I can find out.

avatar wilsonge
wilsonge - comment - 4 Mar 2016

Gary you're hitting the SSL certificate issue :( that error is unrelated to this PR - But JM's test is good enough I'll go back through things again!

avatar richard67
richard67 - comment - 4 Mar 2016

@wilsonge Check your skype ;-)

avatar wilsonge
wilsonge - comment - 4 Mar 2016

It updating to beta 4 is expected. I created it as a beta 4 test package and renamed the zip to exploit a feature in the Joomla Update component :p anyhow clearly an issue so I'll set to work on it!

avatar richard67
richard67 - comment - 5 Mar 2016

In order to get this issue here solved in the right way, my PR #9303 should be tested and if ok be merged first.

Then this PR here could be changed so the installer script.php can check if conversion status in database is equal to excpected conversion status according to utf8mb4 support (2 is yes, 1 if no) at script runtime, and run the conversion only if those values are not equal. This would also handle correctly data having been migrated from old non-utf8mb4 to new utf8mb4 database.

In the same way I will have to change with a new PR the schema manager (db fix) database.php so it runs the convertion only if necessary.

So whoever has time please test PR #9303 even if it does not have the 3.5.0-blocker label (yet).


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

avatar wilsonge
wilsonge - comment - 5 Mar 2016

OK I've just rebased this on staging. So this branch now includes @richard67 's changes

avatar richard67
richard67 - comment - 5 Mar 2016

@wilsonge Well, the only thing which is missing in this PR here to make it perfect is a check if the conversion status in database (column "converted" in table "#__utf8_conversion") is equal to what is expected according to utf8mb4 support at script runtime, i.e. variable $converted (setting of this vasriable has to be moved to before step 1 of conversion).

If you want I make a PR to your repo and branch of this PR.

avatar richard67
richard67 - comment - 5 Mar 2016

The conversion then should be run only if expected status and saved status in db differ.

avatar richard67
richard67 - comment - 5 Mar 2016

@wilsonge Ah or maybe I should make a PR for having it in the database driver as a function, like this serverClaimsUtf8mb4Supoort (or so), which returns true for all other server types and in case of mysql true if conversion status in db is 2 (=utf8mb4) and false otherwise? You could use this then in your PR here. Or you do it with your PR here, too? Let me know what you prefer pls.

avatar wilsonge
wilsonge - comment - 5 Mar 2016

Anything in JDatabaseDriver I can't use in here for the same reason as the other functions :( - if you are updating through extension manager you are using the old version of JDatabaseDriver in this function

avatar richard67
richard67 - comment - 5 Mar 2016

Ahhh sorry, I forgot (must be age related) :smile:

Then the only place where we would call this function would be the input filter and maybe the database fixer, but for the latter it would not really be neccessary because can check that himself.

Await my PR to your PR here with necessary changes for the check.

avatar wilsonge
wilsonge - comment - 5 Mar 2016

Long term putting it in the database check is ok - because I think in the not too distant future (for various reasons) we will stop people using Extension Manager to upgrade Joomla - maybe as soon as 3.6 -- so it can't hurt to have it there - but we can't use it in this PR for now

avatar richard67
richard67 - comment - 5 Mar 2016

@wilsonge Have sent PR no. 23 wilsonge#23 to your repo. Please check also my comments.

avatar Bodge-IT
Bodge-IT - comment - 5 Mar 2016

So is this ready to test GDubya?

avatar wilsonge
wilsonge - comment - 5 Mar 2016

Not right now. I'm just having a think about a few things!

avatar brianteeman brianteeman - change - 5 Mar 2016
Category SQL Updating
avatar brianteeman brianteeman - change - 5 Mar 2016
Labels
avatar wilsonge wilsonge - change - 5 Mar 2016
Labels
avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2016
Labels Added: ?
avatar wilsonge
wilsonge - comment - 5 Mar 2016

OK I'm happy with this now - i'm just going to go generate a new testing zip

avatar richard67
richard67 - comment - 5 Mar 2016

@wilsonge Please merge my last commit to your repo and this branch first ... I had to correct errors from my previous ones.

avatar richard67
richard67 - comment - 6 Mar 2016

Joomla! Update component with provided custom URL works well for both types of database with and without utf8mb4 support. Will check Extensions Installer now.


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

avatar wilsonge
wilsonge - comment - 6 Mar 2016

@Bodge-IT ready for testing now!

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

I have tested this item :white_check_mark: successfully on b2c8a55

Tested both with success database with and without utf8mb4 support.

Could not test extension installer because or remote test environment and upload problems.


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

avatar richard67
richard67 - comment - 6 Mar 2016

Hint for other testers: The custom update URL (xml) works only for updating 3.x but not for 2.5 because the details XML referred in the 1st xml is not prepared for that. With the zip this should work also for 2.5.


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

avatar infograf768
infograf768 - comment - 6 Mar 2016

I suggest to add the link to the Database page in the language string, i.e.
JLIB_DATABASE_ERROR_DATABASE_UPGRADE_FAILED="MySQL Database Upgrade failed. Please check the <a href="index.php?option=com_installer&view=database">Database Fixer</a>."

avatar Bodge-IT Bodge-IT - test_item - 6 Mar 2016 - Tested successfully
avatar Bodge-IT
Bodge-IT - comment - 6 Mar 2016

I have tested this item :white_check_mark: successfully on b2c8a55

Updated using Custom URL:
Database info shows OK, tables in DB show utf8mb4_unicode_ci


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9297.
@richard67 Test instructions advise updating from 3.4.8. Can test from 2.5.28 if necessary.

avatar Bodge-IT
Bodge-IT - comment - 6 Mar 2016

Just tested this on another site using the extension method and update failed.
joomla-utf8up
Pressing Fix finished the update

avatar andrepereiradasilva andrepereiradasilva - test_item - 6 Mar 2016 - Tested unsuccessfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

I have tested this item :red_circle: unsuccessfully on b2c8a55

Update method: Install from URL

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0-beta3 (your custom zip)
Result: HTTP 500 error

Upgrade path: 3.2.7 (clean with sample test data) -> 3.5.0-beta3 (your custom zip)
Result: HTTP 500 error

Upgrade path: 3.4.8 (clean with sample test data) -> 3.5.0-beta3 (your custom zip)
Result: upgrade ok, but tables not converted to utf8mb4_unicode_ci (converted = 0)


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

avatar richard67 richard67 - test_item - 6 Mar 2016 - Tested unsuccessfully
avatar richard67
richard67 - comment - 6 Mar 2016

I have tested this item :red_circle: unsuccessfully on b2c8a55

Meanwhile I could fix my upload problems and so could test extension installer, too, and can fully confirm @andrepereiradasilva 's findings.

Also the 500 error in some case.

It seems we have a problem only whn using extension installer, update component works.

@wilsonge Maybe you rename this pr to solve the update component method only and say it's ok and do the extension installer with another new PR?


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

when another test is needed say so

avatar wilsonge
wilsonge - comment - 6 Mar 2016

The problem is the 500 error. Can someone confirm if we have a 500 error without this PR applied when using Extension Manager? I'd be happy to merge this if it's confirmed that this isn't the source of that?

avatar richard67
richard67 - comment - 6 Mar 2016

Well, but even then we have to solve that with extension manager the conversion is not performed at the end.

avatar wilsonge
wilsonge - comment - 6 Mar 2016

In a worse case I'm happy to use the same message to ensure that users are shown a message to go to the database fixer tabs. The majority of people use Joomla Update! so to me that's the most important thing. If Extension Manager people don't get a 500 error and show a "kind" error message to go check Database Fixer manually I'm happy with that for 3.5.0

avatar richard67
richard67 - comment - 6 Mar 2016

Can check that tomorrow, if I get 500 error also without this PR.

avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

@wilsonge
Update method: Upload

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 3 (official)
Result: Upgraded with success

So, the 500 error occurs only with this changes (it seems)

avatar wilsonge
wilsonge - comment - 6 Mar 2016

We've made quite a few changes since Beta 3 - I wouldn't call that a definite result - but it's enough for me to have a long look into this and try and figure out wtf is going on. Thanks @andrepereiradasilva :)

avatar richard67
richard67 - comment - 6 Mar 2016

Or with other changes in staging since Beta 3 ... would be good to test this with staging. I will find some time for that tomorrow afternoon maybe.

avatar andrepereiradasilva
andrepereiradasilva - comment - 6 Mar 2016

if anyone can make an install package of the latest staging i can test.

avatar wilsonge
wilsonge - comment - 6 Mar 2016

Give me an hour and I can have one

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

@wilsonge
Update method: Upload

Upgrade path: 2.5.28 (clean with sample data) -> 3.5.0 beta 4 update package (official)
Result: 500 error

error log

PHP message: PHP Notice:  Undefined property: InstallerController::$input in /path/to/joomla-25/administrator/components/com_installer/controller.php on line 37
PHP message: PHP Fatal error:  Call to a member function get() on null in /path/to/joomla-25/administrator/components/com_installer/controller.php on line 37
avatar wilsonge
wilsonge - comment - 7 Mar 2016

OK that can't be new - that's a standard JInput line - and as JInput wasn't available in Joomla 2.5 I guess it kinda makes sense (although it would mean that any 2.5 to 3.x install would do that - depending on when we swapped that instance from JRequest to JInput). What about 3.4.8 or 3.2?

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

please keep in mind that in my test after the 500 error i can login back to a broken admin panel, and i'm at 3.5.0 beta 4, so this error log exists everytime i open an extensions view, or anything that uses the filter. so the problem seems to happen in the upgrade but i have no information of what problem.
The error log (500 error) happens after the upgrade process i think (when reloading the install page)

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

@wilsonge
Update method: Upload

Upgrade path: 3.2.7 (clean with sample data) -> 3.5.0 beta 4 FULL package (official)
Result: 500 error, but after login again i'm on 3.5.0.beta4 and all seems to work...

error log

PHP Fatal error:  Class 'Joomla\Registry\Registry' not found in /path/to/joomla-327/libraries/cms/module/helper.php on line 169
avatar wilsonge
wilsonge - comment - 7 Mar 2016

Fml. What a mess. We only put in JRegistry in 3.3 (iirc) so again I guess it makes sense - it's trying to load old versions of files....

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

@wilsonge
Update method: Upload

Upgrade path: 3.4.8 (clean with sample data) -> 3.5.0 beta 4 UPDATE package (official)
Result: Success

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

it was something that changed from beta 3 to beta 4, since beta 3 worked fine.

avatar wilsonge
wilsonge - comment - 7 Mar 2016

What worked upgrading to beta 3 sorry?

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

everything. upgrade from 2.5.28, from 3.2.7 and from 3.4.8 to 3.5.0 beta 3 all worked fine.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

ups i got a 500 error now .... upgrading from 2.5.28 to 3.5.0 beta 3

avatar mbabker
mbabker - comment - 7 Mar 2016

JInput wasn't available in Joomla 2.5

JInput was in 2.5. JController::$input didn't exist in 2.5 (JControllerLegacy::$input in 3.x).

The class aliasing is new as of Joomla 3.3.0.

If this is all updating via the Extension Manager it makes sense why you'd hit these errors (because everything pre-3.5 is still loaded into memory). Why it's new with the last package beats the piss out of me but all roads point to that upgrade method causing catastrophic failures across the board.

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

yes, it seems it happens with 3.5.0 beta 3 too

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

just tested from 2.5.28 to 3.4.8 update package and worked fine, and using the same method (extension -> install -> upload)
i have been logged out as normal after 3.4.8 update

avatar wilsonge
wilsonge - comment - 7 Mar 2016

I just tested going from 3.4.8 to 3.5 beta 4 succesfully - clearly it's not a reliable 500 error :P But as it is the same (seemingly) without and without this patch I'm going to merge this and then we can go back and work on extension manager

avatar wilsonge wilsonge - change - 7 Mar 2016
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2016-03-07 10:05:59
Closed_By wilsonge
avatar wilsonge wilsonge - reference | c8a23b4 - 7 Mar 16
avatar wilsonge wilsonge - merge - 7 Mar 2016
avatar wilsonge wilsonge - close - 7 Mar 2016
avatar wilsonge wilsonge - change - 7 Mar 2016
Labels Removed: ?
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

I just tested going from 3.4.8 to 3.5 beta 4 succesfully - clearly it's not a reliable 500 error :P But as it is the same (seemingly) without and without this patch I'm going to merge this and then we can go back and work on extension manager

I never got problem from 3.4.8 to any beta.
The problems are in older versions (2.5.28 and 3.2.7) to 3.5.0 beta.

But the problem has nothing to do with this PR. So yes this should be merged.

avatar richard67
richard67 - comment - 7 Mar 2016

@wilsonge What about adding missing query downgrades to libraries/cms/installer/installer.php so future update sql scripts can create tables in the right way, and changing back the administrator/components/com_admin/sql/updates/mysql/3.5.0-2016-02-26.sql also (to use utf8mb4 which will be downgraded if necessary)? Would make sense to do that, or not?

avatar wilsonge wilsonge - head_ref_deleted - 7 Mar 2016
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

@wilsonge @richard67 is there any way for the extension manager recognize that you are updating joomla and when it does so it uses the normal upgrade process.

This way we wouldn't need to be always code and test several different upgrade processes. Only one.
I don't know if this is possible, but if so, i think it would be more easy for everyone.

avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva That was also my question, and I don't have an answer yet.

avatar mbabker
mbabker - comment - 7 Mar 2016

No, it's not. I commented this elsewhere (don't remember where anymore), but the first point that the API is aware of what is being installed is well after the Extension Manager has called the JInstaller library. This library shouldn't be handling this type of detection/redirect activity (the fact we have so many API level functions coupled to components means we have absolute garbage abstraction layers, see how tightly coupled com_categories and com_tags are to the core).

With that said, JInstaller::install() (which is what the Extension Manager's Install view will always trigger, the internal API will figure out whether it needs to treat it as an update to an existing extension) dispatches an onExtensionBeforeInstall event. Given there is already a PlgExtensionJoomla you could theoretically add a listener for that event to the plugin which handles the redirect.

And that plugin is pretty much guaranteed to always be enabled. Otherwise no extension ever gets its update sites registered (seriously, an "integral" part of extensions is left to the plugin layer instead of integrated directly into the install API, I'm still fixing my desk from when I head -> desk after discovering that).

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

And that plugin is pretty much guaranteed to always be enabled. Otherwise no extension ever gets its update sites registered (seriously, an "integral" part of extensions is left to the plugin layer instead of integrated directly into the install API, I'm still fixing my desk from when I head -> desk after discovering that).

image

Lol. always thought that plugin was very very very strange too!

avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Mar 2016

@mbabker @wilsonge @richard67
just an heads up, it seems #9331 was the cause i the 500 errors.

Using a patched version with the sql error corrected (just a space after --) i was able to upgrade from 2.5.28 to 3.5.0 beta 5 (patched version) without any problem.

One thing i notice was that in that upgrade the tables weren't converted to utf8mb4_unicode_ci, the rest worked fine.

Anyway i will wait for @richard67 PR to do the (i hope) final tests.

avatar richard67
richard67 - comment - 7 Mar 2016

@andrepereiradasilva Please check #9332 .

Add a Comment

Login with GitHub to post a comment