Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#5 | change_library_location-2702275-5.patch | 3.26 KB | criz |
Comments
Comment #2
crizHi, thanks for the bug report.
I don't think that removing composer.json is a solution, but will have a look on this.
Comment #3
alexrayu CreditAttribution: alexrayu commentedThanks @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.
Comment #4
crizOkay, 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.
Comment #5
crizAlso 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.
Comment #6
alexrayu CreditAttribution: alexrayu commentedHello 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!
Comment #8
crizThanks for the feedback!