Problem/Motivation

Currently, there is no way to use this module as a dependency in a profile. Working with OpenY we faced to a problem that when libraries folder is locating in a profile this module does not work, because of the path to the library is using only libraries folder in the root directory and module does not expect that libraries could be located in other places.

Proposed resolution

Add supporting module libraries in a case when this module installed, to be sure module will find needed library even if it is locating in a profile.

Remaining tasks

Review patch.

User interface changes

None.

API changes

None.

Comments

ddrozdik created an issue. See original summary.

ddrozdik’s picture

Status: Active » Needs review
StatusFileSize
new628 bytes

Here is a patch.

hamrant’s picture

Status: Needs review » Reviewed & tested by the community

Looks good

ddrozdik’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new614 bytes

I found an issue with the latest patсh. Here is update version.

  • ddrozdik committed cae0b8f on 8.x-1.x
    Issue #2881820 by ddrozdik: Module can't find library in profile...
ddrozdik’s picture

Status: Needs review » Fixed
finne’s picture

This fix breaks the loading of the js file when you deploy to a subdir of the server document root (when the base path is not just "/"). It hard-codes the base path as "/".

finne’s picture

StatusFileSize
new595 bytes

Added fixed patch that uses base_path() instead of "/".

finne’s picture

Status: Fixed » Needs review
sylvainm’s picture

CKEditorPluginInterface::getFile() doc says: "Returns the Drupal root-relative file path to the plugin JavaScript file."
So, when adding base_path() or "/", it becomes an absolute, and wrong, path: "/libraries/panelbutton"

I think it should be "libraries/panelbutton".
README says: "Place the plugin in the root libraries folder (/libraries).", so you can't place the library elsewhere.

attached patch

sylvainm’s picture

StatusFileSize
new581 bytes

Sorry, wrong patch…

ckaotik’s picture

This is actually a regression from #2756597: Plugin path should not provide leading slash which contains quite a bit of discussion and originally fixed the problem. I've also marked #2907730: Module can't find library is a duplicate of this issue (because this one is much older).

Also, credit should be added for people that contributed to those issues as well, since even the patch files are identical.
All three issues have the same solution, and it's a shame that this has crept back in. We might want to consider adding a test for this?

lukasss’s picture

#11 needs to be fixed

tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Works for me, as well.

partdigital’s picture

Confirm, the patch in #11 works for me.

alex_optim’s picture

StatusFileSize
new1.12 KB

I recreate patch, use the better way. This is the issue is similar to this https://www.drupal.org/project/ckeditor_font/issues/2900789

alex_optim’s picture

StatusFileSize
new1.14 KB
dakwamine’s picture

#11 worked for me.

Unfortunately, #17 didn't work for me. The generated path was still starting with a / character.

miroslav-lee’s picture

#11 worked for me too.

ddrozdik’s picture

I agree with @ckaotik in the #12 comment that it makes sense to add a test to cover this issue and make sure it will not happen again. I created a new issue for this #3031293: Create a test to check the library path is correct.

At this moment I will merge #11 to fix the issue until we get a better-worked solution. I like the idea proposed in comments #16 and #17, but it does not work for me as well.

  • ddrozdik committed bcd5c39 on 8.x-1.x
    Issue #2881820 by ddrozdik, alex_optim, SylvainM, finne, ckaotik,...
ddrozdik’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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