Closed (fixed)
Project:
D7 Media
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2013 at 10:32 UTC
Updated:
8 Nov 2013 at 21:50 UTC
Jump to comment: Most recent, Most recent file
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