Problem: When Composer Manager is installed and running, it finds shariff module's composer.json and install the library shariff to the drupal/libraries/shariff folder, where it is not used, since the library manually copied into the module's libraries/shariff folder is used.

Solution: Remove composer.json, since it is completely unused, and also does not work well with the Composer Manager.

CommentFileSizeAuthor
#5 change_library_location-2702275-5.patch3.26 KBcriz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexrayu created an issue. See original summary.

criz’s picture

Hi, thanks for the bug report.
I don't think that removing composer.json is a solution, but will have a look on this.

alexrayu’s picture

Thanks @criz. Removing the json file may not be a good solution, but the only other option is to have the module support the Composer Manager (there is already an issue for that). Then, the library would be placed in the /vendor directory of the drupal root. But if that will take some time to implement, or you are not sure if you want to, then it would make sense to remove the json file, because as it is now, it is caught by the Composer Manager and the shariff library gets checked out at /libraries/shariff in the drupal root, which just litters the code base, since it's never used there.

criz’s picture

Okay, I understand the issue. Maybe using the sitewide libraries folder/ vendor folder in drupal root to save/load the shariff library would be the best option. Because I don't see a way to fix/get the module path in the composer.json - maybe some people are still placing the module in the sites folder.

criz’s picture

Also see #2605130: Best practices for handling external libraries in Drupal 8/9 and 10
As having a /libraries folder in Drupal root is now a best practice we just should move it there.
Please test if the patch is working for you.

alexrayu’s picture

Hello Criz. I have applied the patch, moved the library as per docs, reinstalled the module, placed the block, and confirm that it works. Thank you very much for your contribution!

  • criz committed f3bead7 on 8.x-1.x
    Issue #2702275 by criz: Change libraries folder location
    
criz’s picture

Status: Active » Fixed

Thanks for the feedback!

Status: Fixed » Closed (fixed)

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