Problem/Motivation

I have Media 2.2 using the CKEditor CDN with the required plugins for media_ckeditor added locally.

I can insert an image into my body content and save it all okay - the image is rendered and alignment options respected.

When I come to edit the node (revisions enabled and Workbench moderation on) if I right click the image and try to select 'Media settings' I am directed to a 404 screen which the url /media/undefined/format-form cannot be found. Double clicking gives me the image options but I cannot get back to the Media settings window. Clicking the image then re-clicking the media button goes to 404 page.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Andy_D created an issue. See original summary.

Andy_D’s picture

Exception faults are

JS Error appears on line 23:

if (jQuery(data.node).is('[data-media-element]')) {

DOMException: Failed to execute 'querySelectorAll' on 'Element': '*, :x'

Console error is:
GET (sitename)/media/undefined/format-form?render=media-popup&fields=undefined 404 (Not Found)

  • (anonymous) @ VM546 jquery.min.js?v=1.10.2:5
  • domManip @ VM546 jquery.min.js?v=1.10.2:5
  • append @ VM546 jquery.min.js?v=1.10.2:5
  • x.fn.(anonymous function) @ VM546 jquery.min.js?v=1.10.2:5
  • _create @ jquery.ui.dialog.min.js:4
  • (anonymous) @ jquery.ui.widget.min.js:4
  • _createWidget @ jquery.ui.widget.min.js:4
  • e.(anonymous function).(anonymous function) @ jquery.ui.widget.min.js:4
  • (anonymous) @ jquery.ui.widget.min.js:4
  • each @ VM546 jquery.min.js?v=1.10.2:4
  • each @ VM546 jquery.min.js?v=1.10.2:4
  • e.fn.(anonymous function) @ jquery.ui.widget.min.js:4
  • Drupal.media.popups.mediaStyleSelector @ media.popups.js?v=7.x-2.2:233
  • invoke @ library.js?oq1h6y:32
  • exec @ /sites/all/modules/contrib/media_ckeditor/js/plugins/media/plugin.js?t=F969:59
  • exec @ ckeditor.js:172
  • execCommand @ ckeditor.js:235
  • exec @ /sites/all/modules/contrib/media_ckeditor/js/plugins/media/plugin.js?t=F969:67
  • exec @ ckeditor.js:172
  • execCommand @ ckeditor.js:235
  • onClick @ ckeditor.js:678
  • (anonymous) @ ckeditor.js:28
  • (anonymous) @ ckeditor.js:683
  • (anonymous) @ ckeditor.js:29
  • callFunction @ ckeditor.js:29
  • onclick @ VM376 edit:1
joseph.olstad’s picture

Project: Media CKEditor » D7 Media
FileSize
305 bytes

moving this to 'media' queue

clues in bold:
(sitename)/media/undefined/format-form?render=media-popup&fields=undefined

attached is a patch for the media module

joseph.olstad’s picture

Status: Active » Needs review
joseph.olstad’s picture

Please test the patch out and get back to us. (apply it to the media module)
either way, let us know if this helps.

joseph.olstad’s picture

@Andy_D , did the attached patch help you?

Andy_D’s picture

@joseph.olstad - thanks for responding so quickly!

I reviewed my setup and found out that the CDN enabled version of CKEditor does not reference locally installed plugins. I therefore downloaded the full CKEditor package, added the suggested plugins and it all started working. Probably a good idea to have this patch anyway in case someone else gets in a similar pickle!

Thanks again.

joseph.olstad’s picture

Version: 7.x-2.0-rc3 » 7.x-2.3
Category: Bug report » Support request

hmm, ok makes sense, whenever in doubt, use the recipe
https://www.drupal.org/node/2843391

as for the patch, I haven't tested the patch, not sure if it'll help that situation.

I think the correct solution is to install the plugins and ckeditor library locallly as you have done. However, if there's a better way, let us know.

joseph.olstad’s picture

Status: Needs review » Fixed

support issue appears to be resolved. Not sure if we need that patch

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

Andy_D’s picture

Happy to mark this fixed - with the proviso that you cannot use CDN hosted CKEditor!