Summary: | Add a method for plugins to return the absolute path for bundled files | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Plugin architecture | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | new feature | ||
Priority: | P5 - low | CC: | agustinmoyano, arthur.suzuki, hayleypelham, kyle, lucas, martin.renvoize, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This new feature allows plugin authors to construct absolute paths to resources contained within their plugins using the new `bundle_path` method.
This can be used to aid in serving static content.
**Warning**: Care should be taken when installing any plugins and only plugins you trust should be used.
|
Version(s) released in: |
19.11.00
|
Circulation function: | |||
Bug Depends on: | 21073 | ||
Bug Blocks: | 22835, 26803 | ||
Attachments: |
Bug 22834: Add tests for Koha::Plugins::Base->bundle_path
Bug 22834: Add Koha::Plugins::Base->bundle_path Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Bug 22834: Add Koha::Plugins::Base->bundle_path Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Bug 22834: Add Koha::Plugins::Base->bundle_path Bug 21073: (follow-up) QA fixes after rebase Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Bug 22834: Add Koha::Plugins::Base->bundle_path Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Bug 22834: Add Koha::Plugins::Base->bundle_path |
Description
Tomás Cohen Arazi (tcohen)
2019-05-02 18:29:03 UTC
Created attachment 89258 [details] [review] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Created attachment 89259 [details] [review] Bug 22834: Add Koha::Plugins::Base->bundle_path This patch adds a 'bundle_path' method that return the base path for assets included in the plugin. The idea is that it will be used for calculation of the absolute path in the filesystem for static content. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: The method is not implemented - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Created attachment 89260 [details] [review] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Created attachment 89261 [details] [review] Bug 22834: Add Koha::Plugins::Base->bundle_path This patch adds a 'bundle_path' method that return the base path for assets included in the plugin. The idea is that it will be used for calculation of the absolute path in the filesystem for static content. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: The method is not implemented - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Created attachment 89660 [details] [review] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Created attachment 89661 [details] [review] Bug 22834: Add Koha::Plugins::Base->bundle_path This patch adds a 'bundle_path' method that return the base path for assets included in the plugin. The idea is that it will be used for calculation of the absolute path in the filesystem for static content. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: The method is not implemented - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Works as expected, the gif provided as an example is very rewarding, thanks ;) Made my day. wrong bz, sry... (In reply to Arthur Suzuki from comment #7) > Works as expected, the gif provided as an example is very rewarding, thanks > ;) > Made my day. Created attachment 89809 [details] [review] Bug 21073: (follow-up) QA fixes after rebase Created attachment 89810 [details] [review] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Created attachment 89811 [details] [review] Bug 22834: Add Koha::Plugins::Base->bundle_path This patch adds a 'bundle_path' method that return the base path for assets included in the plugin. The idea is that it will be used for calculation of the absolute path in the filesystem for static content. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: The method is not implemented - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Indeed, While trying to install some plugin I had to deal with having several "plugin_dir" in my koha-conf.xml. That led to some errors in the plugin page (see https://github.com/bywatersolutions/koha-plugin-support/issues/9) That would be solved by this patch. I guess we can push for QA. Created attachment 90181 [details] [review] Bug 22834: Add tests for Koha::Plugins::Base->bundle_path Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 90182 [details] [review] Bug 22834: Add Koha::Plugins::Base->bundle_path This patch adds a 'bundle_path' method that return the base path for assets included in the plugin. The idea is that it will be used for calculation of the absolute path in the filesystem for static content. To test: - Apply the unit tests patch - Run: $ kshell k$ prove t/db_dependent/Plugins.t => FAIL: The method is not implemented - Apply this patch - Run: k$ prove t/db_dependent/Plugins.t => SUCCESS: Tests pass! - Sign off :-D Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Nice work! Pushed to master for 19.11.00 backported to 19.05.x for 19.05.08. backporting this without the bz21073 dependency after speaking with Tomas. Enhancement will not be backported to 18.11.x series. |