/src/Plugin/CKEditorPlugin/MediaEmbedButton.php defines an absolute path to the mediaembed library that presumes any site using the module is running from the top level of a given domain:

$path = '/libraries/mediaembed';

A consequence of this is that if a site is running from, for example, a sub folder, the module will be unable to locate the CKEditor library it needs.

This issue can be reproduced by serving a site from a sub folder, e.g., http://localhost:8888/drupal-sandbox/web, and attempting to configure a text format, e.g., http://localhost:8888/drupal-sandbox/web/admin/config/content/formats/ma.... In this context, it is impossible to add the mediaembed button to an editor, because CKEditor JS loader can't find it. The specific error in the browser console is:

Uncaught Error: [CKEDITOR.resourceManager.load] Resource name "mediaembed" was not found at "/libraries/mediaembed/plugin.js?t=H7NE".

This is probably just a matter of using base_path() in the path definition, which I am happy to submit as a patch.

Comments

acephale created an issue. See original summary.

acephale’s picture

StatusFileSize
new539 bytes
acephale’s picture

Status: Active » Needs review

  • HongPong committed 30b173c on 8.x-1.x authored by acephale
    Issue #2941126 by acephale: Plugin library cannot be found if site is...
hongpong’s picture

Status: Needs review » Fixed

Thank you @acephale , I tagged release 8.x-1.0-alpha2 with your fix today!

Status: Fixed » Closed (fixed)

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