? Success

User tests: Successful: Unsuccessful:

avatar wilsonge
wilsonge
15 Apr 2016

Summary of Changes

Update jQuery and jQuery migrate to their latest versions

Testing Instructions

jQuery is loaded on pretty much every single page of Joomla. Navigate around frontend and backend checking for javascript errors

avatar wilsonge wilsonge - open - 15 Apr 2016
avatar wilsonge wilsonge - change - 15 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Added: ?
avatar RickR2H
RickR2H - comment - 15 Apr 2016

@wilsonge
Accessing the articles in the backend I get an error:
Error: Syntax error, unrecognized expression: a[data-toggle="tab"]a[href*=#attrib-params]
jquery.min.js:2:12733


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

avatar mbabker
mbabker - comment - 15 Apr 2016

That looks like a change related to jQuery 1.12.0 in general. I know something like it came up in jQuery's bug tracker or on their release article's comments, I don't recall though if they said it was a "won't fix" or something else.

avatar AnneKlapwijk AnneKlapwijk - test_item - 15 Apr 2016 - Tested unsuccessfully
avatar AnneKlapwijk
AnneKlapwijk - comment - 15 Apr 2016

I have tested this item :red_circle: unsuccessfully on 177a634

I tested a couple of views in the backend and frontend.

Found no javascript errors, but in pretty much every page a javascript warning appears:
:warning: JQMIGRATE: jQuery( '#' ) is not a valid selector jquery-migrate.js:43

Before applying the patch there was no such warning.


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

avatar ggppdk
ggppdk - comment - 15 Apr 2016

@RickR2H
i see the same error but the selector syntax is not according to documentation it lacks the double quotes, it needs to be fixed anyway

@wilsonge
can you also fix the 2 bad selectors at:
media/system/js/tabs-state.js
https://github.com/joomla/joomla-cms/blob/staging/media/system/js/tabs-state.js#L22
https://github.com/joomla/joomla-cms/blob/staging/media/system/js/tabs-state.js#L27

and add the missing Quotes like this:

var $el = $('a[data-toggle="tab"]a[href*="' + href + '"]');
return $('a[data-toggle="tab"]a[href*="' + href + '"]').length;

after fix it will work with jQuery v1.11.x too
this PR is opportunity to find these and fix them

avatar brianteeman brianteeman - change - 16 Apr 2016
Category External Library JavaScript
avatar joomla-cms-bot
joomla-cms-bot - comment - 8 May 2016

This PR has received new commits.

CC: @AnneKlapwijk


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

avatar wilsonge
wilsonge - comment - 8 May 2016

This hasn't fixed things yet - just rebased onto the latest version of Joomla. Going to fix things now :)

avatar joomla-cms-bot
joomla-cms-bot - comment - 8 May 2016

This PR has received new commits.

CC: @AnneKlapwijk


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

avatar wilsonge
wilsonge - comment - 8 May 2016

OK I've fixed the tab's state issue as suggested. The issue from jQuery migrate i don't think is fixable. It's coming deep from bootstraps' dropdown component and I don't see how to solve it - I think it's just one of those things from running ancient old Bootstrap versions. It's only warning from jQuery migrate - it's not a loss of functionality

avatar ggppdk
ggppdk - comment - 8 May 2016

The warning related to the bootstrap dropdown appears with the jQuery version that is currently used too, but it is not coming from jQuery migrate instead it is comming from jquery.min.js:

Empty string passed to getElementById().1 jquery.min.js: ....

avatar wilsonge
wilsonge - comment - 8 May 2016

It would appear somewhere we are missing a selector. But I have absolutely no clue where :(

avatar C-Lodder
C-Lodder - comment - 11 May 2016

Tested the latest with com_patchtester on pretty much all views (inc new and edit) and repeatable form fields

No errors as described above. Everything working as expected

avatar ggppdk
ggppdk - comment - 11 May 2016

Hhmm, i have re-tested,

  • the syntax errors were patched as discussed above, and indeed and they no longer occur

about the empty selector warning,

  • i do not get it to appear any more, which form / page will make it appear ?
avatar C-Lodder
C-Lodder - comment - 11 May 2016

@ggppdk - Which view are you getting this on and what browser?

avatar ggppdk
ggppdk - comment - 11 May 2016

@C-Lodder

I re-edited (immediately) and corrected my original message,

maybe you read it via an email notification ?
... it submitted while i was editing it ... and it was incomplete

if you read it again you will see , that i say that i do not get any errors or warnings

avatar andrepereiradasilva andrepereiradasilva - test_item - 11 May 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 11 May 2016

I have tested this item :white_check_mark: successfully on 4bca4fe

Did a 15 minutes test opening and clicking everything i could remember in isis and protostar with chrome debug console preserving logs in the console.

Only found a js error closing the module opened by the "Edit" button of the article/modules modals in menu items that already existed before this PR
index.php?option=com_content&view=article&tmpl=component&layout=modal&id=37:68 Uncaught TypeError: Cannot read property 'parent' of null

So it seems ok.


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 11 May 2016

ups just found one .. so not success after all
Extension -> Install
jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: a[data-toggle="tab"]a[href*=#package]**

avatar andrepereiradasilva
andrepereiradasilva - comment - 11 May 2016

More 3 discovered using egrep, can't find a case where they are used to check if they produce error or not. But since they don't have quotes in the selector...

/path/to/joomla-staging/administrator/components/com_plugins/views/plugin/tmpl/edit.php:
<a href="#" onclick="jQuery('.nav-tabs a[href=#description]').tab('show');">

/path/to/joomla-staging/administrator/components/com_templates/views/style/tmpl/edit.php:
<a href="#" onclick="jQuery('.nav-tabs a[href=#description]').tab('show');">

/path/to/joomla-staging/administrator/components/com_modules/views/module/tmpl/edit.php:
<a href="#" onclick="jQuery('.nav-tabs a[href=#description]').tab('show');">
avatar JoomliC
JoomliC - comment - 11 May 2016

Only found a js error closing the module opened by the "Edit" button of the article/modules modals in menu items that already existed before this PR
index.php?option=com_content&view=article&tmpl=component&layout=modal&id=37:68 Uncaught TypeError: Cannot read property 'parent' of null

@andrepereiradasilva cc @wilsonge : this error is not related to the jQuery version change, but was already there in edit module modal, with 3.5.1 without jQuery library update. (you have it too in article edit modal now on staging just because i have applied the same script as the one used before with module, and didn't check it (as i thought this script was already working with no error...), and i only changed html and bootstrap renderModal.).
So, nothing to do with jQuery version update :+1:
(now, this gives me one more PR to do to find a way to check this script... : -| )

avatar ggppdk
ggppdk - comment - 12 May 2016

@wilsonge

to summarize ...
can you patch the 3 more bad selectors found by andrepereiradasilva and some more:


files:
administrator/components/com_plugins/views/plugin/tmpl/edit.php
administrator/components/com_templates/views/style/tmpl/edit.php
administrator/components/com_modules/views/module/tmpl/edit.php

<a href="#" onclick="jQuery('.nav-tabs a[href=#description]').tab('show');">

should be (we need to use escaped single quotes in this case):

<a href="#" onclick="jQuery('.nav-tabs a[href=\'#description\']').tab('show');">

administrator/components/com_installer/views/install/tmpl/default.php

return $('a[data-toggle="tab"]a[href*=' + href + ']').length;

should be:

return $('a[data-toggle="tab"]a[href="' + href + '"]').length;

components\com_finder\helpers\html\filter.php(177):

$html .= "<button class=\"btn\" type=\"button\" class=\"jform-rightbtn\" onclick=\"jQuery('[id=tax-"
    . $bk . "]').each(function(){this.click();});\"><span class=\"icon-checkbox-partial\"></span> "
    . JText::_('JGLOBAL_SELECTION_INVERT') . "</button><hr/>";

should be: ? (i did not test)


installation\template\index.php(115):

$(".btn-group input[checked=checked]").each(function()

should be:

$(".btn-group input[checked='checked']").each(function()

Also some these (but they are currently unused i think this JS is no longer in use ?)
libraries\cms\html\grid.php(342):
libraries\cms\html\grid.php(337):

$(this).closest(\'form\').find(\'input[type=checkbox]\').each(function(){

should be: ? (i did not test)

avatar brianteeman
brianteeman - comment - 13 May 2016

jquery is also included in the isis template - should it not be updated there as well

administrator/templates/isis/js/jquery.js

avatar Bakual
Bakual - comment - 13 May 2016

Why on earth does ISIS have its own jQuery version? Is that even used?
Lets delete that one and make sure it uses the core one instead...

avatar brianteeman
brianteeman - comment - 13 May 2016

No idea - I just spotted it when checking

On 13 May 2016 at 10:11, Thomas Hunziker notifications@github.com wrote:

Why on earth does ISIS have its own jQuery version? Is that even used?
Lets delete that one and make sure it uses the core one instead...


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#9935 (comment)

Brian Teeman
Co-founder Joomla! and OpenSourceMatters Inc.
http://brian.teeman.net/

avatar Bakual
Bakual - comment - 13 May 2016

See #10445
I think it's a leftover from the initial creation of the template.

avatar brianteeman
brianteeman - comment - 15 May 2016

Shouldnt we be updating jqueryui at the same time


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

avatar C-Lodder
C-Lodder - comment - 15 May 2016

@brianteeman - I think there was a reason why jQueryUI wasn't update to it's latest version. Can't remember why, but I think there was some biggish bugs that it caused

avatar joomla-cms-bot
joomla-cms-bot - comment - 4 Jun 2016

This PR has received new commits.

CC: @andrepereiradasilva, @AnneKlapwijk


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

avatar wilsonge
wilsonge - comment - 4 Jun 2016

Our jQuery UI version in 3.x was 1.8.23. We upgraded to 1.9 without issues however in the 1.10 upgrade docs (http://jqueryui.com/upgrade-guide/1.10/) it says

Note that most 1.8 APIs which were deprecated in 1.9 were removed in 1.10 and will not exist, regardless of the $.uiBackCompat flag

So we can't upgrade any further in 3.x because of b/c :(

I have also updated all the deprecated syntax instances in this PR as per comments

avatar yvesh yvesh - test_item - 5 Jun 2016 - Tested successfully
avatar yvesh
yvesh - comment - 5 Jun 2016

I have tested this item successfully on 52e749a

Did an one hour test in backend and frontend (with Protostar), also with some 3rd party extensions. Everything is working fine so far, did not find any js error.

Slight issue: On almost every page in the backend there is an message (console.log) from jQuery Migrate (with debugging turned on):

JQMIGRATE: jQuery( '#' ) is not a valid selector

Easiest way to replicate:

Go to the media manager (/administrator/index.php?option=com_media), click on powered_by image for the lightbox popup and close it again. Message should show up in the console.

2016-06-05_09-48-11

Did not debug it further.


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

avatar ggppdk
ggppdk - comment - 5 Jun 2016

Unfortunately, not all extensions are quoting the selectors that are like:

a[vvv=...]

(correct for newer jQuery versions):

a[vvv="..."]
  • even if they quote most of the cases, they may well have missed some cases, after jQuery is upgraded, JS of some extensions will break

e.g.
with a quick search through my code, i found that i am quoting 95% of such selectors but i have missed some ...

avatar AshanFernando
AshanFernando - comment - 5 Jun 2016

I have Tested the backend and frontend in Google Chrome. So far no JavaScript errors found. Test

avatar Ruchiranga Ruchiranga - test_item - 5 Jun 2016 - Tested successfully
avatar Ruchiranga
Ruchiranga - comment - 5 Jun 2016

I have tested this item successfully on 52e749a

Spent about 30 minutes moving around the site both in the front end and back end and didn't come across any errors in the Chrome debug console.


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

avatar ggppdk
ggppdk - comment - 5 Jun 2016

About my comment,

  • it was just a note that some extensions will break, about our own extensions, we will update the selectors

I am in favour of upgrading jQuery, that is why i took time to test this PR too, and report some findings

avatar wilsonge
wilsonge - comment - 7 Jun 2016

None of the old selectors break anything - they just now raise errors in the console. So no extensions will break

avatar wilsonge
wilsonge - comment - 7 Jun 2016

I need this in for the 3.6 beta tonight so i'm going to do some horrifically bad practice stuff and merge my own code now with the one good test ://

avatar wilsonge wilsonge - change - 7 Jun 2016
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-06-07 19:41:11
Closed_By wilsonge
avatar wilsonge wilsonge - close - 7 Jun 2016
avatar wilsonge wilsonge - merge - 7 Jun 2016
avatar wilsonge wilsonge - reference | d11fc47 - 7 Jun 16
avatar wilsonge wilsonge - merge - 7 Jun 2016
avatar wilsonge wilsonge - close - 7 Jun 2016
avatar wilsonge wilsonge - change - 7 Jun 2016
Milestone Added:
avatar wilsonge wilsonge - head_ref_deleted - 7 Jun 2016
avatar schultz-it-solutions
schultz-it-solutions - comment - 15 Jul 2016

Hello team,
now that you updated jQuery to "v1.12.4", are there any plans to also update jQuery UI from the "rather outdated" jQuery UI - v1.9.2 - 2013-07-14 to a more recent version?
And if so, are there any plans to include "more functionality" than just the "sortable"?
Best regards
Ruediger Schultz

avatar wilsonge
wilsonge - comment - 15 Jul 2016

Sadly not. The problem is that jQuery has jQuery migrate to allow us to upgrade keeping backwards compatibility. However jQuery UI has no such tool. We started on jQuery 1.8 and jQuery 1.10 made backwards incompatible changes with the 1.8 API :(

avatar omikron
omikron - comment - 18 Aug 2016

Today I upgraded a website running 3.4.8 to 3.6 then to 3.6.2 and I am receiving this error in global configuration;

jquery.min.js:2 Uncaught Error: Syntax error, unrecognized expression: a[data-toggle="tab"]a[href*=#page-system]

It is breaking the hidden field sections throughout global configuration. Is there something missed when using that upgrade path?


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

avatar C-Lodder
C-Lodder - comment - 18 Aug 2016

@omikron - No console errors for me in Global Config. Can you try clearing your browser cache and trying again?

avatar omikron
omikron - comment - 19 Aug 2016

Had done that or so I thought.. worked fine in incognito window. Thanks!


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

avatar andrepereiradasilva
andrepereiradasilva - comment - 21 Aug 2016

found two forgotten selectors without quotes here: #11708

Add a Comment

Login with GitHub to post a comment