[Bug 21520] New: More complex OAI sets mappings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Bug ID: 21520 Summary: More complex OAI sets mappings Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: rbit@rbit.cz QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com OAI sets mappings should allow "AND" operator as well as more complex condition defintion. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Radek Šiman (R-Bit Technology, s.r.o.) <rbit@rbit.cz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |black23@gmail.com, | |josef.moravec@gmail.com, | |mist@alastify.cz -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 matti.lassila@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matti.lassila@gmail.com --- Comment #1 from matti.lassila@gmail.com --- Support for regular expressions in set selection operator in particular would be useful. It is common for free text fields to have slight variation depending when bibliographic record has been created, so exact match doesn't work very well for creating sets. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |matthias.meusburger@biblibr | |e.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #2 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 96041 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96041&action=edit Bug 21520: More complex OAI sets mappings Currently, the rules used to create OAI sets are processed with the 'or' boolean operator between each rule. This patch allows to use 'or' or 'and' between the rules. The evaluation of the rules is done according to the boolean operators precedence: AND has a higher precedence than OR. For example: A and B or C and D will be evaluated as follow: (A and B) or (C and D) Test plan: - Apply the patch - Apply the atomicupdate - Prove t/db_dependant/OAI/AndSets.t - Check that existing mappings still work - Try modifying existing mappings - Try creating new mappings - Check that the boolean operators precedence is correctly taken into account -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #3 from Michal Denar <black23@gmail.com> --- Hello Mathias, thank you for patch. I tested it but if I add AND operator, whole updated set gone from OAI: vagrant@kohadevbox:kohaclone(bug_21520)$ sudo koha-foreach --enabled /usr/share/koha/bin/migration_tools/build_oai_sets.pl -i -r Summary: Set 'test': 303 biblios Set 'NKP': 303 biblios Updating database... done. vagrant@kohadevbox:kohaclone(bug_21520)$ sudo koha-foreach --enabled /usr/share/koha/bin/migration_tools/build_oai_sets.pl -i -r Summary: Set 'NKP': 303 biblios Updating database... done. Can you review code? Thank you. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #4 from Michal Denar <black23@gmail.com> --- Sorry, my fault. Wrong boolean operators. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Michal Denar <black23@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96041|0 |1 is obsolete| | --- Comment #5 from Michal Denar <black23@gmail.com> --- Created attachment 96052 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96052&action=edit Bug 21520: More complex OAI sets mappings Currently, the rules used to create OAI sets are processed with the 'or' boolean operator between each rule. This patch allows to use 'or' or 'and' between the rules. The evaluation of the rules is done according to the boolean operators precedence: AND has a higher precedence than OR. For example: A and B or C and D will be evaluated as follow: (A and B) or (C and D) Test plan: - Apply the patch - Apply the atomicupdate - Prove t/db_dependant/OAI/AndSets.t - Check that existing mappings still work - Try modifying existing mappings - Try creating new mappings - Check that the boolean operators precedence is correctly taken into account Great work! Signed-off-by: Michal Denar <black23@gmail.com> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org Status|Signed Off |Failed QA --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hi Matts, A couple QA remarks: 1. FAIL koha-tmpl/intranet-tmpl/prog/en/modules/admin/oai_set_mappings.tt FAIL tt_valid lines 49, 50, 77, 78 You are not allowed to build a HTML tag using TT conditional as it breaks the translator script. 2. update database: a. rule_order is always null, is that expected? b. first rule should have a null for "rule_operator", isn't it? Before: +--------+-----------+--------------+----------+-----------+ | set_id | marcfield | marcsubfield | operator | marcvalue | +--------+-----------+--------------+----------+-----------+ | 3 | 100 | a | equal | pouet | | 3 | 200 | a | equal | pouet | | 3 | 300 | a | equal | pouet | +--------+-----------+--------------+----------+-----------+ After the update: +--------+------------+---------------+-----------+--------------+----------+-----------+ | set_id | rule_order | rule_operator | marcfield | marcsubfield | operator | marcvalue | +--------+------------+---------------+-----------+--------------+----------+-----------+ | 3 | NULL | or | 100 | a | equal | pouet | | 3 | NULL | or | 200 | a | equal | pouet | | 3 | NULL | or | 300 | a | equal | pouet | +--------+------------+---------------+-----------+--------------+----------+-----------+ -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |matthias.meusburger@biblibr |ity.org |e.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #7 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Hi Joubu, thanks for the feedback. 1. I will attach a QA Follow-up 2. a. rule_order is always null, is that expected? => Kind of :) In fact, rule_order will be populated when a rule is modified/created in the GUI. The updatedatabase doesn't need to do it, because at this point, we only have rules with 'or' operator, and the order is not important. b. first rule should have a null for "rule_operator", isn't it? => Same as 2.a. The first rule_operator could have been set to null by the updatedatabase, but it doesn't need to, since it will always be ignored in the code. However, when a rule is modified/created is the GUI, the first rule_operator will be set to null (just for better readability in the database). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #8 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 96790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96790&action=edit Bug 21520: QA Follow-up: do not build html tags with TT conditions -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Matthias Meusburger <matthias.meusburger@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Matthias Meusburger from comment #7) Why not fix the existing data then? That seems quite easy to do. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #10 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Well, I hesitated, but I chose not to, having those two things in mind: - Keep It Simple, Stupid. - If it's not broken, don't fix it. That being said, I can come up with a follow-up for the updatedatabase if you want me to. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #11 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- Created attachment 97319 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97319&action=edit Bug 21520: (QA follow-up): Updatedatabase -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #12 from Matthias Meusburger <matthias.meusburger@biblibre.com> --- rule_order is now set and the first rule_operator of each mapping is set to null. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #96052|0 |1 is obsolete| | Attachment #96790|0 |1 is obsolete| | Attachment #97319|0 |1 is obsolete| | --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97320 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97320&action=edit Bug 21520: More complex OAI sets mappings Currently, the rules used to create OAI sets are processed with the 'or' boolean operator between each rule. This patch allows to use 'or' or 'and' between the rules. The evaluation of the rules is done according to the boolean operators precedence: AND has a higher precedence than OR. For example: A and B or C and D will be evaluated as follow: (A and B) or (C and D) Test plan: - Apply the patch - Apply the atomicupdate - Prove t/db_dependant/OAI/AndSets.t - Check that existing mappings still work - Try modifying existing mappings - Try creating new mappings - Check that the boolean operators precedence is correctly taken into account Signed-off-by: Michal Denar <black23@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97321 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97321&action=edit Bug 21520: QA Follow-up: do not build html tags with TT conditions Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 97322 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=97322&action=edit Bug 21520: (QA follow-up): Updatedatabase Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual, | |release-notes-needed CC| |martin.renvoize@ptfs-europe | |.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |Prior to this patchset, the release notes| |rules used to create OAI | |sets are processed with the | |'or' | |boolean operator | |between each rule. | | | |This | |patch allows to use 'or' or | |'and' between the rules. | | | |The evaluation of the rules | |is done according to the | |boolean operators | |precedence: AND has a | |higher precedence than OR. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |20.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #17 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- OK, I added the kohastructure update inline during push.. and made the DB update idempotent -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 --- Comment #18 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work everyone! Pushed to master for 20.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Joy Nelson <joy@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |joy@bywatersolutions.com Status|Pushed to master |RESOLVED Resolution|--- |FIXED --- Comment #19 from Joy Nelson <joy@bywatersolutions.com> --- Enhancement not backported to 19.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21520 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|release-notes-needed | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org