We should allow the cataloguing or 'valuebuilder' plugins to be installable with the standard plugin architecture.
Created attachment 180283 [details] [review] Bug 39522: Allow Valuebuilders to be installable as plugins Unit tests to follow Test plan: 1. Install the example plugin from https://github.com/Jacobomara901/koha-plugin-value-builder and enable it 2. See that the framework plugin ‘custom_date’ as available to add to a subfield while the installed plugin is enabled and disappears when it is not. 3. Assign custom_date to your preferred Marc subfield (I use 650 subfield 2 ) and navigate to that field on a record of your choice 4. Ensure you are on the correct bib framework. See that the value builder appears while the plugin is enabled and disappears from that field while disabled. 5. Check uninstalling the plugin works correctly
Created attachment 180284 [details] [review] Bug 39522: Add filtering to the plugin home page for valuebuilders
Created attachment 180301 [details] [review] Mark Hofstetter will be following up with unit tests as we worked on this together. Test plan: 1. Install the example plugin from https://github.com/Jacobomara901/koha-plugin-value-builder and enable it 2. See that the framework plugin ‘custom_date’ is available to add to a subfield while the installed plugin is enabled and disappears when it is not. 3. Assign custom_date to your preferred Marc subfield (I use 650 subfield 2 ) and navigate to that field on a record of your choice 4. Ensure you are on the correct bib framework. See that the value builder appears while the plugin is enabled and disappears from that field while disabled. 5. Check uninstalling the plugin works correctly Bug 39522: Allow Valuebuilders to be installable as plugins Co-authored-by: Mark Hofstetter <koha@trust-box.at>
Created attachment 180302 [details] [review] Bug 39522: Add filtering to the plugin home page for valuebuilders Co-authored-by: Mark Hofstetter <koha@trust-box.at>
Created attachment 180337 [details] [review] Mark Hofstetter will be following up with unit tests as we worked on this together. Test plan: 1. Install the example plugin from https://github.com/Jacobomara901/koha-plugin-value-builder and enable it 2. See that the framework plugin ‘custom_date’ is available to add to a subfield while the installed plugin is enabled and disappears when it is not. 3. Assign custom_date to your preferred Marc subfield (I use 650 subfield 2 ) and navigate to that field on a record of your choice 4. Ensure you are on the correct bib framework. See that the value builder appears while the plugin is enabled and disappears from that field while disabled. 5. Check uninstalling the plugin works correctly Bug 39522: Allow Valuebuilders to be installable as plugins Co-authored-by: Mark Hofstetter <mark@hofstetter.at>
Created attachment 180338 [details] [review] Bug 39522: Add filtering to the plugin home page for valuebuilders Co-authored-by: Mark Hofstetter <mark@hofstetter.at>
Created attachment 183467 [details] [review] Bug 39522: Allow Valuebuilders to be installable as plugins This patch adds hooks to allow 'Valuebuilder' plugins to be installable using the standard plugin architecture for Koha. This enables cataloguing plugins to be dynamically installed, enabled, and disabled through the plugin system rather than being hardcoded framework components. Test plan: 1. Install the example valuebuilder plugin from GitHub (https://github.com/Jacobomara901/koha-plugin-value-builder) 2. Go to Administration > Plugins 3. Verify the valuebuilder plugin appears in the plugins list 4. Enable/disable the plugin and confirm the custom valuebuilder appears/disappears in the framework configuration 5. Assign the custom valuebuilder to a MARC subfield in the bibliographic framework 6. Create/edit a bibliographic record and verify the valuebuilder button appears next to the configured subfield 7. Click the valuebuilder button and confirm it functions correctly 8. Disable the plugin and verify the valuebuilder button disappears 9. Re-enable the plugin and confirm functionality is restored 10. Uninstall the plugin and verify it's completely removed Co-authored-by: Mark Hofstetter <koha@trust-box.at>
Created attachment 183468 [details] [review] Bug 39522: Add filtering to the plugin home page for valuebuilders This patch adds filtering functionality to the plugin home page to allow valuebuilder plugins to be displayed alongside other plugins. This ensures that valuebuilder plugins are properly integrated into the plugin management interface and can be easily identified and managed by administrators. Test plan: 1. Install a valuebuilder plugin (following the test plan from the previous patch) 2. Go to Administration > Plugins 3. Verify that the valuebuilder plugin appears in the plugins list 4. Confirm that the plugin shows the correct type/category information 5. Use any available filtering options to verify valuebuilder plugins can be filtered appropriately 6. Verify that valuebuilder plugins display the same management options (enable/disable/configure) as other plugin types 7. Test that plugin status changes are reflected correctly in the filtered view Co-authored-by: Mark Hofstetter <mark@hofstetter.at>
Created attachment 183469 [details] [review] Bug 39522: Add unit tests for valuebuilder plugin hooks This patch adds comprehensive unit tests for the new valuebuilder plugin functionality. The tests verify that plugins can provide valuebuilders through the get_valuebuilder() method and that FrameworkPlugin can correctly load and integrate with plugin-based valuebuilders. The tests use a dedicated TestValuebuilder plugin to ensure realistic testing scenarios without relying on mocks, following the pattern established in other plugin hook tests. Test plan: 1. Run the new test file: prove t/db_dependent/Koha/Plugins/Valuebuilder_hooks.t 2. Verify all tests pass (9 tests total) 3. Run all plugin tests to ensure no regressions: prove t/db_dependent/Koha/Plugins/ 4. Verify all plugin tests still pass (113 tests across 19 files) 5. Test the specific functionality: - Verify plugins without get_valuebuilder() method are not found as valuebuilders - Verify plugins with get_valuebuilder() method are correctly discovered - Verify FrameworkPlugin can load plugin-based valuebuilders - Verify JavaScript generation works with plugin valuebuilders - Verify plugin enable/disable affects valuebuilder availability 6. Confirm FrameworkPlugin integration tests still pass: prove t/db_dependent/FrameworkPlugin.t
We've now got this running in production on our sites at OpenFifth. The Homosaurus plugin is a great example of using it. * https://github.com/openfifth/koha-plugin-homosaurus-value-builder
This looks like it's working correctly but the QA script has lots of complaints