In build 7.x-2.0-beta1+10-dev, the media browser's Browse button doesn't appear when using Entity Embed to embed a file into the editor. But it disables the file-upload field, thus preventing the use of Entity Embed at all.
The problem appears to be the changes to media.js introduced in beta1+10; using media.js from beta1+9 fixes the issue. Given that this is the principal change in beta1+10, it means this latest build is incompatible with Entity Embed.
I can't actually figure out why the updated javascript doesn't attach properly, hopefully someone who understands it better than me will be able to!
Comment | File | Size | Author |
---|---|---|---|
#12 | media-browser-2690669-12.patch | 457 bytes | RickJ |
| |||
#3 | media-js_browser_behavior-2690669-3.patch | 2.76 KB | ron_s |
|
Comments
Comment #2
ron_s CreditAttribution: ron_s commentedThere are a few issues with the changes made in the most recent version:
.once
and.removeOnce
should be applied as part of afunction
, rather than in a string of selectors..siblings
is not appropriate. It needs to be either.find
or.children
. Since.find
is slightly more performant than.children
,.find
has been used in the patch.See the attached file for review.
Comment #3
ron_s CreditAttribution: ron_s commentedAfter further testing, patch #2 needs some adjustment. It works correctly for the Entity Embed button, but does not render the form item correctly when it is a basic file field on a content type. The code that had been added was correct.
This patch combines the two together.
Comment #4
jose.cely CreditAttribution: jose.cely as a volunteer commentedI solved the problem with patch #2 .
I have Drupal 7.44 and patch Media 7.x-2.0-beta2 and works.
Thanks a lot!
Comment #5
ron_s CreditAttribution: ron_s commented@jose.cely, you should not use Patch #2. It does not work correctly for fields on a content type that have been set to use the Media Browser.
You must use Patch #3.
Comment #6
smsivaprakaash CreditAttribution: smsivaprakaash commentedI tried applying both the patches, it is not working as expected(Media browser button is not getting displayed)
Media module- 7.x-2.0-beta2
Entity Embed - 7.x-2.0-alpha3+3-dev
File entity - 7.x-2.0-beta3+3-dev
Comment #7
ron_s CreditAttribution: ron_s commented@smsivaprakaash, please see the title of this thread. The patch is for 7.x-2.x-dev, not 7.x-2.0-beta2. In fact, patches should never be applied to release versions of code. They are always to the -dev version.
Comment #8
smsivaprakaash CreditAttribution: smsivaprakaash commentedyeah right, but i saw the following tread says, it worked for beta2 version. So i thought it would be appropriate to post here. I ll give a try with the dev version.
Thanks!
Comment #9
ron_s CreditAttribution: ron_s commentedHe also said he used patch #2, when I specifically said to use patch #3. Patch #2 is bad.
Comment #10
Schubie CreditAttribution: Schubie commentedIs there a solution for the missing media browser button? I can only see the button in beta1. Any version above beta1 seems to be broken to me.
Comment #11
codemannSame issue here after updating media from beta1 to the latest rc on an existing website. We're not using entity_embed, yet still no media browser button.
Yet on a clean install from a new project this upgrade never caused issues.
Maybe a different issue, but it feels close?!
Comment #12
RickJ CreditAttribution: RickJ commentedA few people have noted that this can be fixed by changing the calling code that adds the media-browser form item to specify the #theme property as 'media-widget'. See https://www.drupal.org/node/2288487.
However, this breaks backward compatibility with the media module's own API, so seems to me a bit unsatisfactory. It would be better to correct the default #theme property in the media module itself. The attached one-line patch does this, and works in my testing.
I don't know if this change has any negative side-effects, maybe someone can check it out?
Comment #13
joseph.olstadThanks @Rick J , your fix appears to be the correct one.
Comment #15
joseph.olstadcommitted to 7.x-2.x dev