Summary: | MARC modification templates do not handle control fields in conditional | ||
---|---|---|---|
Product: | Koha | Reporter: | Michael Kuhn <mik> |
Component: | Tools | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | benjamin.r.philbrook, fridolin.somers, jonathan.druart, josef.moravec |
Version: | master | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
19.11.00,19.05.02
|
|
Bug Depends on: | |||
Bug Blocks: | 25840 | ||
Attachments: |
Bug 22571: Add tests
Bug 22571: Handle control fields in MMT for conditionals Bug 22571: Add tests Bug 22571: Handle control fields in MMT for conditionals Bug 22571: (follow up) fix Donald cut-&-paste error Bug 22571: Add tests Bug 22571: Handle control fields in MMT for conditionals Bug 22571: (follow up) fix Donald cut-&-paste error |
Description
Michael Kuhn
2019-03-24 19:48:56 UTC
Created attachment 89362 [details] [review] Bug 22571: Add tests Created attachment 89363 [details] [review] Bug 22571: Handle control fields in MMT for conditionals Control fields are not handled correctly by Koha::SimpleMARC when comparaison (with or without regex) is done. Which means we did not support something like: Do something if control field 008 equals or matches "a string" Test plan: Create a new MARC modification template and a new action, like: Add new field 100$a with value "foo bar" if 008 (or any other control fields) matches (or equals) a regex Then use the record mofication tool and confirm that the new field is create if the regex matches 008 of the bib record Created attachment 90683 [details] [review] Bug 22571: Add tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 90684 [details] [review] Bug 22571: Handle control fields in MMT for conditionals Control fields are not handled correctly by Koha::SimpleMARC when comparaison (with or without regex) is done. Which means we did not support something like: Do something if control field 008 equals or matches "a string" Test plan: Create a new MARC modification template and a new action, like: Add new field 100$a with value "foo bar" if 008 (or any other control fields) matches (or equals) a regex Then use the record mofication tool and confirm that the new field is create if the regex matches 008 of the bib record Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 90685 [details] [review] Bug 22571: (follow up) fix Donald cut-&-paste error Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Created attachment 90896 [details] [review] Bug 22571: Add tests Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 90897 [details] [review] Bug 22571: Handle control fields in MMT for conditionals Control fields are not handled correctly by Koha::SimpleMARC when comparaison (with or without regex) is done. Which means we did not support something like: Do something if control field 008 equals or matches "a string" Test plan: Create a new MARC modification template and a new action, like: Add new field 100$a with value "foo bar" if 008 (or any other control fields) matches (or equals) a regex Then use the record mofication tool and confirm that the new field is create if the regex matches 008 of the bib record Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 90898 [details] [review] Bug 22571: (follow up) fix Donald cut-&-paste error Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Nice work! Pushed to master for 19.11.00 Pushed to 19.05.x for 19.05.02 I just tested the original case in Koha 20.05.00, but wasn't successful: After creating a MARC modification template in Koha menu "Tools > Batch record modification" with the following action: Add new field 041$a with value ger if 008 matches RegEx m/^...................................ger..$/ I also tried the following action (omitting ^and $): Add new field 041$a with value ger if 008 matches RegEx m/...................................ger../ The action is run over a given record and Koha says that the bibliographic record has successfully been modified - but in fact nothing has changed, thus no new MARC 041$a is created. (In reply to Michael Kuhn from comment #11) > I just tested the original case in Koha 20.05.00, but wasn't successful: > > After creating a MARC modification template in Koha menu "Tools > Batch > record modification" with the following action: > > Add new field 041$a with value ger if 008 matches RegEx > m/^...................................ger..$/ > > I also tried the following action (omitting ^and $): > > Add new field 041$a with value ger if 008 matches RegEx > m/...................................ger../ > > The action is run over a given record and Koha says that the bibliographic > record has successfully been modified - but in fact nothing has changed, > thus no new MARC 041$a is created. Hi Michael, if a bug has already been 'released' please don't reopen but open a new bug and link to this one instead - bugzilla will email everyone on the linked bug too. |