Summary: | Enable framework plugins when UseACQFrameworkForBiblioRecords is set | ||
---|---|---|---|
Product: | Koha | Reporter: | Julian Maurice <julian.maurice> |
Component: | Acquisitions | Assignee: | Julian Maurice <julian.maurice> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | normal | ||
Priority: | P5 - low | CC: | david, fridolin.somers, lucas, m.de.rooy, martin.renvoize |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31582 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31536 |
||
Change sponsored?: | --- | Patch complexity: | Medium patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: |
This bugfix enables the use of framework plugins when:
- `UseACQFrameworkForBiblioRecords` is enabled, and
- entering catalog details when adding items to a basket from a new (empty) record.
This requires plugins to be enabled for fields in the `ACQ` framework.
|
Version(s) released in: |
23.05.00,22.11.06
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 34993 | ||
Attachments: |
Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set
Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set Bug 32484: Replace DateTime->now by Koha::DateUtils::dt_from_string Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set Bug 32484: Replace DateTime->now by Koha::DateUtils::dt_from_string Bug 32484: (QA follow-up) Fixes to POD Bug 32484: (QA follow-up) Polishing unit test Bug 32484: (QA follow-up) Few typos |
Description
Julian Maurice
2022-12-16 15:31:00 UTC
Created attachment 144690 [details] [review] Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set Test plan: 1. Do not apply the patch yet 2. Make sure you have an ACQ biblio framework with some framework plugins enabled. Create it if you don't. 3. Enable UseACQFrameworkForBiblioRecords system preference 4. Create a new acquisition basket. 5. On this new basket, click on "+ Add to basket", then "From a new (empty) record" 6. You should see a simplified MARC editor based on ACQ framework. Confirm that the plugins are not enabled (no visible buttons, nothing happening on focus/blur) 7. Apply patch 8. Repeat step 5 9. You should now see the plugins' buttons (only if you enabled plugins that use the 'click' event) 10. Confirm that the enabled plugins work correctly Created attachment 144706 [details] [review] Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set Test plan: 1. Do not apply the patch yet 2. Make sure you have an ACQ biblio framework with some framework plugins enabled. Create it if you don't. 3. Enable UseACQFrameworkForBiblioRecords system preference 4. Create a new acquisition basket. 5. On this new basket, click on "+ Add to basket", then "From a new (empty) record" 6. You should see a simplified MARC editor based on ACQ framework. Confirm that the plugins are not enabled (no visible buttons, nothing happening on focus/blur) 7. Apply patch 8. Repeat step 5 9. You should now see the plugins' buttons (only if you enabled plugins that use the 'click' event) 10. Confirm that the enabled plugins work correctly Signed-off-by: David Nind <david@davidnind.com> Testing notes (using KTD): 1. MARC21 doesn't have as many framework plugins as UNIMARC. 2. I tested as follows - hope this is sufficient: 2.1 Using the 'Fixed length control field (00000)': before the patch is applied it is automatically generated, but you can't select any options - after the patch you can select options. 2.2 Added 005 (Date and time of last transaction) to the ACQ framework and used the marc21_field_005.pl plugin: before the patch is applied there is no value automatically applied to the field, after the patch is applied you can click on the field and it is populated. 3. The catalog details label width is very narrow - I think this should be widened, as was done as an exception for the item fields. FAIL koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt FAIL js_in_body A <script> tag found inside head, must be moved to the body (see bug 17858) FAIL t/db_dependent/Koha/UI/Form/Builder/Biblio.t FAIL forbidden patterns forbidden pattern: Use of DateTime->now should certainly be replaced with dt_from_string (bug 24840) (line 36) Created attachment 147298 [details] [review] Bug 32484: Replace DateTime->now by Koha::DateUtils::dt_from_string (In reply to Marcel de Rooy from comment #4) > FAIL koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt > FAIL js_in_body > A <script> tag found inside head, must be moved to the body > (see bug 17858) Framework plugins do not work when all script tags are at the end of <body>. That's why I moved them inside <head> > FAIL t/db_dependent/Koha/UI/Form/Builder/Biblio.t > FAIL forbidden patterns > forbidden pattern: Use of DateTime->now should certainly be > replaced with dt_from_string (bug 24840) (line 36) Fixed by the last patch Koha/UI/Form/Builder/Biblio.pm | 372 +++++++++++++++ acqui/neworderempty.pl | 60 ++- cataloguing/addbiblio.pl | 350 +++----------- .../prog/en/modules/acqui/neworderempty.tt | 444 +++++++++--------- koha-tmpl/intranet-tmpl/prog/js/cataloging.js | 3 +- t/db_dependent/Koha/UI/Form/Builder/Biblio.t | 182 +++++++ Could you explain why we need to move so much code here? Hard to catch bugs in such refactoring ;) Trust me, I don't move code for fun :) I needed to reuse the code from addbiblio.pl in neworderempty.pl so I moved it into a Koha:: module, that's it. Looking here This test ( $applydefaults =~ /changed/ && $changed_framework ) || wont work for default fw but currently we focus here on ACQ? Created attachment 149798 [details] [review] Bug 32484: Enable plugins when UseACQFrameworkForBiblioRecords is set Test plan: 1. Do not apply the patch yet 2. Make sure you have an ACQ biblio framework with some framework plugins enabled. Create it if you don't. 3. Enable UseACQFrameworkForBiblioRecords system preference 4. Create a new acquisition basket. 5. On this new basket, click on "+ Add to basket", then "From a new (empty) record" 6. You should see a simplified MARC editor based on ACQ framework. Confirm that the plugins are not enabled (no visible buttons, nothing happening on focus/blur) 7. Apply patch 8. Repeat step 5 9. You should now see the plugins' buttons (only if you enabled plugins that use the 'click' event) 10. Confirm that the enabled plugins work correctly Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 149799 [details] [review] Bug 32484: Replace DateTime->now by Koha::DateUtils::dt_from_string Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 149800 [details] [review] Bug 32484: (QA follow-up) Fixes to POD Resolve: FAIL Koha/UI/Form/Builder/Biblio.pm FAIL pod coverage POD is missing for build_authorized_values_list POD is missing for create_key Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 149801 [details] [review] Bug 32484: (QA follow-up) Polishing unit test Test plan, removed done_testing. License. Since we are in t/db, good to add transaction, although we currently do not change anything here. But who knows? Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 149802 [details] [review] Bug 32484: (QA follow-up) Few typos Test plan: Run git grep "specifique key" Run git grep "the fonction" Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Thank you Marcel for the QA and the follow-ups :) Pushed to master for 23.05. Nice work everyone, thanks! *** Bug 31582 has been marked as a duplicate of this bug. *** It appears that this fixed bug 31582. Any chance we could reasonably consider this for backporting maybe? This will also help immensely in not creating false record with missing LDR etc. Many hands makes light work, thankyou everyone! Pushed to 22.11.x for the next release Pushed as requested. Enhancement will not be backported to the 22.05.x series |