VideoDetectorCKEditorButton.php
line 37-41
$path = '/libraries/videodetector';
return array(
'VideoDetector' => array(
'label' => t('Video detector ckeditor button'),
'image' => $path . '/icons/videodetector.svg',

replace by

return array(
'VideoDetector' => array(
'label' => t('Video detector ckeditor button'),
'image' => base_path().'libraries/videodetector/icons/videodetector.svg',

line 52-53
$path = '/libraries/videodetector';
return $path . '/plugin.js';

replace by
return base_path().'libraries/videodetector/plugin.js';

Comments

JFH created an issue. See original summary.

JFH - 3DX internet’s picture

Issue summary: View changes
awasson’s picture

Status: Active » Needs review
StatusFileSize
new1.78 KB

@JFH is correct. I have trested those changes and they do indeed work as described. I've attached a patch for your module.

Cheers,
Andrew

awasson’s picture

Thinking a little more on this. Perhaps a ckeditor_videodetector.libraries.yml file would be ideal for this module?

I will investigate and post back.

Andrew

aoturoa’s picture

StatusFileSize
new1.34 KB

I like the ckeditor_videodetector.libraries.yml approach.

Furtermore using 'base_path()' isn't optimal, better is using 'libraries_get_path()' once a dependency on libraries is added.

aoturoa’s picture

StatusFileSize
new1.5 KB

The following patch applies to current 8.x-1.0 release.

awasson’s picture

Yes, I think that is a much better approach and more in line with the OOP/MVC approach taken in D8.

darol100’s picture

Status: Needs review » Fixed

The libraries module in D8 is not does not have a stable version nor have a clear direction future of that project. For this reason, I do not think is smart idea to added as dependency. This issue is related to #2758579: Best way for getFile to retrieve file(s) from the /libraries directory?, which is been solve in this commit.

Status: Fixed » Closed (fixed)

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