User tests: Successful: Unsuccessful:
Update jQuery and jQuery migrate to their latest versions
jQuery is loaded on pretty much every single page of Joomla. Navigate around frontend and backend checking for javascript errors
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
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.
I have tested this item 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:
JQMIGRATE: jQuery( '#' ) is not a valid selector
jquery-migrate.js:43
Before applying the patch there was no such warning.
@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
Category | ⇒ | External Library JavaScript |
This PR has received new commits.
CC: @AnneKlapwijk
This hasn't fixed things yet - just rebased onto the latest version of Joomla. Going to fix things now :)
This PR has received new commits.
CC: @AnneKlapwijk
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
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: ....
It would appear somewhere we are missing a selector. But I have absolutely no clue where :(
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
Hhmm, i have re-tested,
about the empty selector warning,
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
I have tested this item 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.
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]**
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');">
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
(now, this gives me one more PR to do to find a way to check this script... : -| )
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)
jquery is also included in the isis template - should it not be updated there as well
administrator/templates/isis/js/jquery.js
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...
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/
Shouldnt we be updating jqueryui at the same time
@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
This PR has received new commits.
CC: @andrepereiradasilva, @AnneKlapwijk
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
I have tested this item
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.
Did not debug it further.
Unfortunately, not all extensions are quoting the selectors that are like:
a[vvv=...]
(correct for newer jQuery versions):
a[vvv="..."]
e.g.
with a quick search through my code, i found that i am quoting 95% of such selectors but i have missed some ...
I have Tested the backend and frontend in Google Chrome. So far no JavaScript errors found. Test
I have tested this item
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.
About my comment,
I am in favour of upgrading jQuery, that is why i took time to test this PR too, and report some findings
None of the old selectors break anything - they just now raise errors in the console. So no extensions will break
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 ://
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-06-07 19:41:11 |
Closed_By | ⇒ | wilsonge |
Milestone |
Added: |
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
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 :(
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?
Had done that or so I thought.. worked fine in incognito window. Thanks!
@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.