I see the above javascript error when I try to select an image from the media library. The popup then defaults to the first tab.
There was an attempt to fix this in passing in https://drupal.org/node/1957812 but this is a separate incompatibility so I'm filing as a separate issue. There is a patch on that issue that attempted to fix this in one place, but at least as of 7.x-2.0-alpha9 there are actually two places that need fixing (while maintaining support for older versions of jQuery UI).
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 2089913-media-browser-select-tab-jquery-ui.patch | 1.31 KB | dave reid |
| #3 | media-2089913-3-no-such-method-select.patch | 1.65 KB | ianthomas_uk |
| #1 | 2089913-1-no-such-method-select.patch | 1.6 KB | ianthomas_uk |
Comments
Comment #1
ianthomas_ukHere's a patch, based on the patch and discussion in https://drupal.org/node/1957812
I've switched the version check around for forward compatibility and included jQuery UI 1.9 in the versions that get the new code (as the documentation shows this method was removed in 1.9).
I still don't see the media browser tab being selected, but that's because Drupal.media.browser.activeTab is always set to 0 in my testing. If that's not the correct behaviour, please file a followup issue - in my testing this patch does fix the js error and selects the tab that Drupal.media.browser.activeTab is set to.
Comment #2
killua99 commentedCould you write this with the Drupal CS? is terrible read this code.
https://drupal.org/node/172169
https://drupal.org/coding-standards#operators
Comment #3
ianthomas_ukFair point. Here is the same patch using if/else.
Comment #4
aaron commentedI do not get the original behavior reported using jquery UI version 1-10-2. I do not know if that is because they have reverted the deprecated function or not.
Comment #5
ianthomas_ukAre you sure that you're definitely using jQuery UI version 1.10 and that the patched lines are running? I've had another look at the documentation and while we can use both syntaxes in 1.9, I can't see anything to suggest that the select syntax will be supported in any future version of jQuery UI.
http://jqueryui.com/upgrade-guide/1.9/#deprecated-select-method
http://jqueryui.com/upgrade-guide/1.10/#removed-select-method-use-active...
http://jqueryui.com/changelog/
Comment #6
sylus commentedThis fixed me receiving the same js error. And coincidentally when I first click on media browser the resize on first load actual fits all the content (instead of being cut off about 20px and working when tab back and forth).
I am using jQuery v1.8 and jQuery UI 1.10.2.
Tested on media according to:
I'd like to mark this as RTBC or should wait for more comments?
Comment #7
sylus commentedComment #8
thijsvdanker commented+1 RTBC. It fixes the warning and works as expected!
Comment #9
aaron commented#3: media-2089913-3-no-such-method-select.patch queued for re-testing.
Comment #10
dave reidSeeing code duplicated made me think we should actually have a function that could be reused. Let's try this version out.
Comment #11
dave reidTested and committed #10 to 7.x-2.x. http://drupalcode.org/project/media.git/commit/9b91d5d