Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Media Version: 7.x-2.0-alpha4+27-dev
Media Gallery Version: 7.x-2.x-dev
I tried to create a new gallery and got blank white screen.
PHP error log:
PHP Fatal error: Call to undefined function media_attach_browser_js() in /drupal_site/sites/all/modules/media_gallery/media_gallery.module on line 317
Now I get the same when I got to default galleries page.
This comment says that:
It seems the media_include_browser_js() function doesn't exist in Media 2.x-dev.
Comment | File | Size | Author |
---|---|---|---|
#16 | media_gallery-removed_media_js_helpers-2458471-16.patch | 838 bytes | nedjo |
Comments
Comment #1
Mihail.Swetliy CreditAttribution: Mihail.Swetliy commentedI see this error only if a log in the system. If i see it as a quest - i have not problems with view.
Somebody can soled this problem?
Comment #2
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedDowngrade the media module.
The js helper functions were removed in the latest media module.
https://www.drupal.org/node/2465057
Comment #3
vulfox CreditAttribution: vulfox commentedYou happen to remember which Media module version?
The module page should be updated with a notice like: "currently works with Media 7.xxxx" or something similar
Comment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedThis media version is working for me:
version = "7.x-2.0-alpha4+11-dev"
core = "7.x"
project = "media"
datestamp = "1416423187"
Comment #5
henryhu CreditAttribution: henryhu commented"7.x-2.0-alpha4" of media is working for me.
Comment #6
mautumn CreditAttribution: mautumn commented"7.x-2.0-alpha4" of media is working for me also. The latest dev release (27) wouldn't.
Comment #7
bsains CreditAttribution: bsains commentedThe last version with - media_attach_browser_js() is - Media version = "7.x-2.0-alpha4+26-dev"
As per the issue here - https://www.drupal.org/node/2454933 - this function was removed.
I've replaced media_attach_browser_js() on line 317 of media_gallery.module with the following and can report all OK.
-media_attach_browser_js($node->content['add_media_link']);
+drupal_add_library('media', 'media_browser');
+drupal_add_library('media', 'media_browser_settings');
As per the patch supplied in the above issue for CkEditor -
https://www.drupal.org/files/issues/Issue_2454933.patch
I'm hesitant to supply a patch as this will need some release co-ordination.EDIT - OK - so just saw dependencies here - Media Gallery 2.x-dev requires Media 2.x-dev - so patch supplied
Comment #8
bsains CreditAttribution: bsains commentedComment #9
matthiasm11 CreditAttribution: matthiasm11 at Randstad Digital commentedI can confirm the patch from #8 works, thanks!
Comment #10
apratt CreditAttribution: apratt commentedI too can confirm the patch in #8 worked well for me.
Comment #11
mallezieThis seems indeed the correct fix.
Comment #12
RedEight CreditAttribution: RedEight at 95Visual commented#8 fixed the problem for me. I'm using Media 7.x-2.0-beta1, File Entity 7.x-2.0-beta2, and Media Gallery 7.x-2.x-dev.
Comment #13
kaido.toomingas CreditAttribution: kaido.toomingas commented#8 worked for me too.
Comment #14
leolandotan CreditAttribution: leolandotan as a volunteer commentedHi guys, I'm using this patch also with Composer through the netresearch/composer-patches-plugin but it fails and gives me this error:
I checked the patch and tried to apply it manually to 7.x-2.x-dev using `git apply -v this-patch.patch` but got the error the the file is corrupted and this patch got applied only through `patch -p0 ...`. I have read that this "style" has been deprecated already as said in Making a Drupal patch with Git. So I just created a patch using the said steps on the guide.
What are your thoughts on this?
Comment #15
kaido.toomingas CreditAttribution: kaido.toomingas commentedHey guys I have to admit. I didn't use the patch. I just looked it and reproduced. I guess dev might be changed at some point and it wouldn't work anymore.
Comment #16
nedjoUpdated patch.
Changes:
drupal_add_library()
.module_load_include()
call.Upgrading to critical as without this fix Media Gallery cannot be used with the current stable release of Media 2.x.
Comment #17
brandonc503 CreditAttribution: brandonc503 commentedok same problem
Call to undefined function media_attach_browser_js() sites/all/modules/media_gallery/media_gallery.module on line 317
so if i can start with ideal modules, which of Media and media gallery are best to start with? ie, can i get ideal modules and not have to patch at all?
cause i just downloaded media 7.x-2.x-dev and media gallery 7.x-2.x-dev hoping to fix and did not
edited*
Media 7.x-2.0-beta1, File Entity 7.x-2.0-beta2, and Media Gallery 7.x-2.x-dev. didnt work
edited*
[SOLVED] comment #16 the patch worked, thanks
Comment #19
Moloc CreditAttribution: Moloc commentedCommitted patch. So media_gallery is compatible with the latest stable version of media.
This patch will break compatibility with media versions < 2.x-beta1. So if you use the latest media-gallery 2.x dev, update media too.
See also: https://www.drupal.org/node/2550247
Comment #20
Moloc CreditAttribution: Moloc commentedComment #21
Moloc CreditAttribution: Moloc commented