Hi,

The media module latest dev version has some changes that affect the CKeditor implementation.

Basically, following their thread here - https://www.drupal.org/node/2454933, the media_browser_js() function have been removed in favour to simplify the media browser settings. It is now handled in a library.

This cause "Call to undefined function media_browser_js()" in includes/ckeditor.lib.inc line: 893

Did not have the chance to track it down yet, but wanted to notify you.

Regards,
Lachezar

Comments

lachezar.valchev’s picture

Issue summary: View changes
pol’s picture

pol’s picture

bneil’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

Here's the patch referenced above. It was referenced from a media issue. Adding it here so it can be applied to the ckeditor project.
Attribution for the patch should go to Pol.

pol’s picture

Thanks !

bneil’s picture

Status: Needs review » Reviewed & tested by the community

The patch fixes the issue for me.

izmeez’s picture

The patch applies as expected.
It impacts on #2159403: Make CKEditor plugin system modular and clean such that patch in that thread will need to be re-rolled.

shane birley’s picture

Patch works for me as well.

jcisio’s picture

Version: 7.x-1.16 » 7.x-1.x-dev
Status: Reviewed & tested by the community » Needs work

We don't chase Media 2.x at the moment. The idea that we agreed on is to support only Media 1.x and replace it with another plugin for Media 2.x.

So, to solve this bug, either we detect Media version to remove this plugin, or in Media 2.x use hook_ckeditor_plugin_alter to replace it.

deanflory’s picture

Patch in #4 FAILS when attempting to be applied to the current 2015-04-01 dev.

Applying it to a previous dev version appears to apply properly and this error goes away:

Fatal error: Call to undefined function media_browser_js() in /.../sites/all/modules/ckeditor/includes/ckeditor.lib.inc on line 893

Needs a re-roll.

izmeez’s picture

Not surprising it needs a re-roll since #2159403: Make CKEditor plugin system modular and clean has been committed.

rcodina’s picture

Patch on #4 works for me on Ckeditor 7.x-1.16. Many thanks! I think best option here is to detect Media version like is said in #9.

mrconnerton’s picture

StatusFileSize
new1.04 KB

reroll

nitebreed’s picture

This check:
module_hook('media', 'filter_info')

isn't valid for the latest Media-7.x-2.x-dev anymore. This hook is now called in media_wsyiwyg.

darrellduane’s picture

Status: Needs work » Reviewed & tested by the community

The patch in #13 worked for me. @Nitebreed, I'm not sure what the impact of your comment is---do we need to make a new patch or will #13 work?

nitebreed’s picture

If you use the latest Media-7.x-2.x-dev then yes, cause otherwise it won't work

mrconnerton’s picture

I will have to double check my dev site. When I rolled the patch I was on the latest dev, at least from 9 days ago.

maxplus’s picture

Thanks,

solved the issue for me!
(see also https://www.drupal.org/node/951004#comment-10024279)

jamesrward’s picture

#13 worked for me on Media 7.x-2.0-alpha4+37-dev

matthiasm11’s picture

+1 for the patch of #13

murias’s picture

Simply want to report that the patch for my setup the patch would not apply, needed to manually apply patch by altering the code. After doing so, the changed code corrected the issues with ckeditor.

colepacak’s picture

#13 worked for me using Media 7.x-2.0-alpha4+41-dev

Thank you!

dave reid’s picture

Taking a step back, I'm curious why the CKEditor module should or can maintain integration with the Media module. We just spun off a new project specifically for maintaining CKEditor.module + Media integration into media_ckeditor. Is there any reason we shouldn't just encourage new users to use that instead?

elkz’s picture

I tried #13 after upgrading Media 7.x-2.0-alpha4 to 7.x-2.0-beta1 but it failed.
I applied this patch and it worked. :)

hcderaad’s picture

#25 references the right patch, applying that one solves the issue, apparently the ckeditor lib file changed between #13 and now.
It seems to make sense to put this media-module specific logic in the separate ckeditor-media module.

geerlingguy’s picture

Is there any reason we shouldn't just encourage new users to use that instead?

@Dave Reid - I think the main reason so many people have things set up this way is that it's been the default way to integrate Media with CKEditor for a long time (old habits die hard). I think, if someone wrote up a quick guide for switching to using the media_ckeditor module to do the same kind of integration, then maybe we could close this issue and open a new one to remove the built-in integration (which seems to have had it's share of issues).

rjdjohnston’s picture

#4 worked for me

jcisio’s picture

Status: Reviewed & tested by the community » Needs work

Re #24: This is for Media 1.x only and this issue is about not to generate error with Media 2.x. Does media_ckeditor also work with Media 1.x? In this case we can completely remove support for Media in this module.

neograph734’s picture

This also applies for Media 2.x and the media_wysiwig sub-module. I just applied the patch from #13 and the issues were gone, so I'd say this is still RTBC.

dave reid’s picture

@jcisio: I posted #2542276: Integration with Media 1.x for review with Devin Carlson, the maintainer of Media CKEditor to see if we should just move the Media 1.x integration from CKEditor to that module. It would require moving branches around in that module as well but I think it would be clearer for end-users to basically install the same Media CKEditor module branch as the current Media module branch that is being used.

jcisio’s picture

Status: Needs work » Closed (duplicate)

Thanks @Dave Reid. I've created #2542566: Remove Media integration. I'm closing this issue because the patch in #13 is still far from a stop-gap.

JasonLee87’s picture

Version: 7.x-1.x-dev » 7.x-1.16

Patch #13 worked for me.

shaktik’s picture

working fine for me #4

Thanks
@bneil

chewtoy’s picture

Hi,

I'm a newb to patching modules, can anyone direct me as to how to apply the patch or to any other way I can apply this fix?

Thanks, I really appreciate it!

neograph734’s picture

chewtoy, have a look here. https://www.drupal.org/patch/apply

rwilson0429’s picture

Updating to the latest dev fixed the problem for me.

chewtoy’s picture

Thanks Neo!

maaciek’s picture

Please make a new tag for CKEditor Drupal Plugin with this patch! It would save a lot of time for many plugin users.

Mark_L6n’s picture

Comments #4 and #25 refer to the same patch, which worked for me using Media 7.x-2.0-beta1, File Entity 7.x-2.0-beta2 and CKEditor 7.x-1.16.
(Patch in #13 is almost identical, except for the part that #14 notes is invalid.)

djordje.lazovic’s picture

Thank you a million for this tip :)

Ante890’s picture

Please launch a new stable release for ckeditor with patch Issue_2454933.patch included.

darrellduane’s picture

I agree with Ante890.

huntelaer’s picture

I got this error on node/add/ pages where ckeditor was enabled after upgrading the media module from 7.x-2.0-alpha4 to 7.x-2.0-rc5.

My solution was to update the ckeditor module to version 7.x-1.17 and to install the media_ckeditor module.

jeffc518’s picture

Huntelaer - Same thing here. I just ran update.php after updating Media (7.x-2.0-rc5) and ran into all kinds of errors. Thing is, I'm not running the CKEditor module, unless you are talking about the WYSIWYG profile, which I do have.

When editing any page, I get:

Fatal error: Call to undefined function media_browser_js() in /srv/bindings/d493fa1bb1b14cb5ac660471f23696b1/code/sites/all/modules/media_wysiwyg/media_wysiwyg.module on line 173

I have the Media WYSIWYG module (Version: 7.x-2.0-alpha3+98-dev) installed, but it has an additional one below:

Media WYSIWYG View Mode (media_wysiwyg_view_mode)
DEPRECATED, this folder is only here so that the module can be uninstalled.
Version: 7.x-2.0-rc5

All are latest versions. Oh, and in my WYSIWYG profile page:

HTML
Unable to find markItUp. Expected version: . Reinstall the library to edit this profile.

Any ideas? :)

brandonratz’s picture

@Huntelaer, Thank you! #44 fixed for me.

https://www.drupal.org/node/2455391#comment-11927317

adam1’s picture

@Huntelaer, Thank you! #44 fixed for me, too.

dibs’s picture

Has any progress been made with this?
Patch works but not ideal. I had to manually edited from line 797 of ckeditor.lib.inc to get it to work.
media Version: 7.x-2.11
ckeditor Version: 7.x-1.9

osopolar’s picture

@dibs: You should use media_ckeditor Module.

After updating Media module to 2.x an update to media_ckeditor 2.x will be necessary and enabling media_wysiwyg if not yet done. At least that was necessary on a clients website which I took over for maintenance.

jaesperanza’s picture

Try to uncheck (disable) "Plugin for inserting images from Drupal media module". In my case, under CKEditor profiles > Editor Appearance:

admin/config/content/ckeditor/edit/Advanced
/admin/config/content/ckeditor/edit/Full