Hi! I've noticedd error jquery.ba-bbq.js?v=1.2.1:28 Uncaught TypeError: Cannot read property 'msie' of undefined on some admin pages e.g. Modules, Views, when using jQuery 3.1 with jquery_update module.

Comments

khiminrm created an issue. See original summary.

khiminrm’s picture

Status: Active » Needs review
StatusFileSize
new502 bytes
damienmckenna’s picture

Project: Drupal core » jQuery Update
Version: 7.x-dev » 7.x-3.x-dev
Component: javascript » Code

While this is great, I think it needs to be added to jQuery Update.

damienmckenna’s picture

Status: Needs review » Needs work

FYI I was having this error on the admin/modules page and I think it was triggered by module_filter. I ended up fixing it by reverting to core's jQuery for admin pages.

mcdruid’s picture

Version: 7.x-3.x-dev » 7.x-4.x-dev
Status: Needs work » Needs review
StatusFileSize
new2.14 KB

Thanks - here's a patch which adds this to the jquery_update module.

It seems to work when a newer jQuery version is added (tested manually with jQuery 3.6 as a custom version).

I've not tested whether it's detecting MSIE correctly but hopefully nobody is too worried about that these days as we'd be talking about IE10 or earlier according to:

https://www.whatismybrowser.com/guides/the-latest-user-agent/internet-ex...

Anyone able to test and confirm before I commit this? (Unfortunately there's no js testing framework in D7 so jquery_update has zero test coverage).

mcdruid’s picture

StatusFileSize
new413 bytes
new2.14 KB

Oops spotted a problem I'd missed.

mcdruid’s picture

I'll also remove the colon after @see: in the js file's comment on commit.

mcdruid’s picture

https://api.jquery.com/jquery.browser/

Looks like jQuery.migrate provides a shim for this, but it doesn't seem to work with recent versions (e.g. jQuery 3.6 and Migrate 3.3.2).

It's good that @khiminrm's fix checks $.browser===undefined first so this shouldn't do anything if jQuery Migrate has already done its magic.

  • mcdruid committed ee158e8 on 7.x-4.x authored by khiminrm
    Issue #3054417 by mcdruid, khiminrm, DamienMcKenna: Deprecated $.browser...
mcdruid’s picture

Status: Needs review » Fixed

Thank you everyone!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.