[Bug 22509] New: Add a script to generate MARC fields containing date formatted strings
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Bug ID: 22509 Summary: Add a script to generate MARC fields containing date formatted strings Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz Target Milestone: --- This will add a simple script to add MARC fields to bibliographic records with date information. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 86586 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=86586&action=edit Bug 22509: Add new script to add MARC fields with date formatted stringsto bib records Say you want to add, into a new MARC fields, the following string: 2/2019/Mar-03/13 Depending on today's date. Test plan: Use the script after with the different options (see --help option for the list) Sponsored-by: Orex Digital -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |hagud@orex.es -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #2 from Hugo Agud <hagud@orex.es> --- Ths script allow a better integration with vufind, and allow to create hierarchy facets by date 1st level year, 2 level mont, third level day NOw the script add the same date to all records but 1. Each record should have its onw date, perhaps import from a marc tag? 2. the script should only apply to records without 905, not recreated -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 87435 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87435&action=edit Bug 22509: Add the --unless-exists option to the script It will avoid to create the fields several times if it is not needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Hugo Agud from comment #2)
Ths script allow a better integration with vufind, and allow to create hierarchy facets by date 1st level year, 2 level mont, third level day
NOw the script add the same date to all records but 1. Each record should have its onw date, perhaps import from a marc tag?
How would be formatted the date?
2. the script should only apply to records without 905, not recreated
Done in the last patch, see the new options --unless-exists. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #86586|0 |1 is obsolete| | --- Comment #5 from Hugo Agud <hagud@orex.es> --- Created attachment 87588 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87588&action=edit Bug 22509: Add new script to add MARC fields with date formatted stringsto bib records Say you want to add, into a new MARC fields, the following string: 2/2019/Mar-03/13 Depending on today's date. Test plan: Use the script after with the different options (see --help option for the list) Sponsored-by: Orex Digital Signed-off-by: Hugo Agud <hagud@orex.es> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #87435|0 |1 is obsolete| | --- Comment #6 from Hugo Agud <hagud@orex.es> --- Created attachment 87589 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=87589&action=edit Bug 22509: Add the --unless-exists option to the script It will avoid to create the fields several times if it is not needed. Signed-off-by: Hugo Agud <hagud@orex.es> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #87588|0 |1 is obsolete| | --- Comment #7 from Hugo Agud <hagud@orex.es> --- Created attachment 88532 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88532&action=edit Bug 22509: Add new script to add MARC fields with date formatted stringsto bib records Say you want to add, into a new MARC fields, the following string: 2/2019/Mar-03/13 Depending on today's date. Test plan: Use the script after with the different options (see --help option for the list) Sponsored-by: Orex Digital Signed-off-by: Hugo Agud <hagud@orex.es> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #87589|0 |1 is obsolete| | --- Comment #8 from Hugo Agud <hagud@orex.es> --- Created attachment 88533 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=88533&action=edit Bug 22509: Add the --unless-exists option to the script It will avoid to create the fields several times if it is not needed. Signed-off-by: Hugo Agud <hagud@orex.es> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Can you explain the use case for this one? It seems a rather specific script. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #10 from Hugo Agud <hagud@orex.es> --- This script it is designed for a better integration of koha database into discoveries, the info of this script is used by discoveries for creating hierarchical Facets. This script created a data like 2019-04-29 into a formatted tag that allows to create hierarchical Facets, in a way that end users may seach for records by year, month or day at the end. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Which date would you index like that? The record creation date? I have never seen anything like that in discoveries. It still appears very specific. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #12 from Hugo Agud <hagud@orex.es> --- usually the creation date yes, and yes again it is specific but for press search is really useful -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- FAIL pod *** ERROR: Apparent command =item not preceded by blank line in file misc/add_date_fields_to_marc_records.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=22509 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 89546 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89546&action=edit Bug 22509: Fix POD error "Apparent command =item not preceded by blank line" -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #15 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I think what Hugo is referring to with the hierarchical facets is this: https://vufind.org/wiki/configuration:facets So it seems that VuFind can build hierarchical facets on all values that are concatenated with / and an ending /. So the 'relationship' to VuFind is there, but it's not very strong :) This script is more general as it allows to add arbitrary formatted date information to any MARC subfield. But it's also a bit limited, as it will use today's date. I have some notes: 1) The misc directory is already a bit chaotic. I would suggest to move this into a new directory in misc where we could keep such scripts in the future. Maybe something like: marc_tools, data_manipulation, marc_manipulation ? 2) If I pass nothing in, the script is run in dry mode. I think it would be better to display the help, since the needed parameters to actually do something are missing. 3) When I run it with -h it advertises: perl add_date_fields_to_marc_records.pl --help But the help displayed doesn't explain the options like it's supposed to looking at the script itself. Can you please take a look at fixing the help? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #89546|0 |1 is obsolete| | --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 89616 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89616&action=edit Bug 22509: Fix POD error 1. "Apparent command =item not preceded by blank line" 2. Display the options for help 3. Do not run if no --field passed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #15) Thanks Katrin for taking a look at this one. POD (2 and 3) fixed. About the path I would prefer to let the RM pick the correct location. IMO it will be weird to have only this script in a new directory. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #18 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Jonathan Druart from comment #17)
(In reply to Katrin Fischer from comment #15)
Thanks Katrin for taking a look at this one.
POD (2 and 3) fixed.
About the path I would prefer to let the RM pick the correct location. IMO it will be weird to have only this script in a new directory.
I think starting with one would be ok, we have to start somewhere. And moving them later is more painful for people, as they have to fix their paths. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #19 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Katrin Fischer from comment #18)
(In reply to Jonathan Druart from comment #17)
(In reply to Katrin Fischer from comment #15)
Thanks Katrin for taking a look at this one.
POD (2 and 3) fixed.
About the path I would prefer to let the RM pick the correct location. IMO it will be weird to have only this script in a new directory.
I think starting with one would be ok, we have to start somewhere. And moving them later is more painful for people, as they have to fix their paths.
Leaving this to the RM indeed :) 1) Can you add a usage example for the WHERE condition? I tried: ./add_date_fields_to_marc_records.pl --where 'biblionumber <10' --field='245$a=1/test/%Y/%b-%m' It should tell which table is queried. It also feels a little odd that it seems like you have to enter --where 'where...'? It seems the where argument on rebuild_zebra.pl works without. 2) The use of unless-exists was not clear to me from the description, I think an example below the option description would be helpful too. Apart from documentation this seems to work fine. If you update that, I am willing to PQA :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> 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=22509 --- Comment #20 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 89626 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89626&action=edit Bug 22509: Add more POD and fix --where We should not need the "WHERE" keyword to have the same behavior as existing script (rebuild_zebra.pl) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #21 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 89627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89627&action=edit Bug 22509: Clarify with an example the usage of --unless-exists -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #22 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Katrin Fischer from comment #19) Hope it makes more sense now. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #89627|0 |1 is obsolete| | --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 89680 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=89680&action=edit Bug 22509: Clarify with an example the usage of --unless-exists Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- RM, please see comment 18 for some discussion about where to store this script! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Keywords| |release-notes-needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version(s)| |19.11.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=22509 --- Comment #25 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice work! Pushed to master for 19.11.00 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Fridolin SOMERS <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |RESOLVED Resolution|--- |FIXED CC| |fridolin.somers@biblibre.co | |m --- Comment #26 from Fridolin SOMERS <fridolin.somers@biblibre.com> --- Enhancement not pushed to 19.05.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |Manual -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |23924 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 [Bug 23924] Add a parameter to the script add_date_fields_to_marc_records.pl to specify a date field -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 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