[Bug 23924] New: Add a parameter to the script add_date_fields_to_marc_records.pl to specify a date field
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Bug ID: 23924 Summary: Add a parameter to the script add_date_fields_to_marc_records.pl to specify a date field 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 Depends on: 22509 This date field will be used to set the date used in the script, instead of today. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22509 [Bug 22509] Add a script to generate MARC fields containing date formatted strings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 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=23924 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 94860 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=94860&action=edit Bug 23924: Add --date-field to add_date_fields_to_marc_records.pl The date used in the script will use this parameter, instead of today. Test plan: Use the POD of the script to understand how this flag works. Then use the script to create fields with a date contained in a specific MARC field. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 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=23924 --- Comment #2 from Hugo Agud <hagud@orex.es> --- I am testing the patch and It works fine but I have a doubt regarding the where clausule... according the help it claims that where limit the search, but I guess the where clausule doens't affect on the search.... becuase it takes the same time using and non usiing where clausule I guess where is limiting where the perl applies the action, not limiting the the bibs to check and apply, right? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Hugo Agud from comment #2)
I am testing the patch and It works fine but I have a doubt regarding the where clausule... according the help it claims that where limit the search, but I guess the where clausule doens't affect on the search.... becuase it takes the same time using and non usiing where clausule
I guess where is limiting where the perl applies the action, not limiting the the bibs to check and apply, right?
It should, if you have biblionumbers from 1 to 1000 and the --where is biblionumber < 500, then only the first 500 records will be processed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 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=23924 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #94860|0 |1 is obsolete| | --- Comment #4 from Hugo Agud <hagud@orex.es> --- Created attachment 95621 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=95621&action=edit Bug 23924: Add --date-field to add_date_fields_to_marc_records.pl The date used in the script will use this parameter, instead of today. Test plan: Use the POD of the script to understand how this flag works. Then use the script to create fields with a date contained in a specific MARC field. 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=23924 Hugo Agud <hagud@orex.es> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #5 from Hugo Agud <hagud@orex.es> --- when processing more than one record, the firts records creates propertly 905 field, but the second one doubles de 905 field with the info from record 1 and record 3 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 98217 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=98217&action=edit Bug 23924: Reset the fields to add We do not want to copy fields from the previous records! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Hugo Agud from comment #5)
when processing more than one record, the firts records creates propertly 905 field, but the second one doubles de 905 field with the info from record 1 and record 3
That was a silly mistake, sorry about that! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Mazen Khallaf <mazen.i.khallaf@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mazen.i.khallaf@gmail.com --- Comment #8 from Mazen Khallaf <mazen.i.khallaf@gmail.com> --- Could you please provide a test plan? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 David Nind <david@davidnind.com> 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=23924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #95621|0 |1 is obsolete| | --- Comment #9 from David Nind <david@davidnind.com> --- Created attachment 149739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149739&action=edit Bug 23924: Add --date-field to add_date_fields_to_marc_records.pl The date used in the script will use this parameter, instead of today. Test plan: Use the POD of the script to understand how this flag works. Then use the script to create fields with a date contained in a specific MARC field. Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #98217|0 |1 is obsolete| | --- Comment #10 from David Nind <david@davidnind.com> --- Created attachment 149740 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149740&action=edit Bug 23924: Reset the fields to add We do not want to copy fields from the previous records! Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #11 from David Nind <david@davidnind.com> --- How I tested (using KTD): 1. Made 905$a and 908$a and visible in editor for the BKS framework. 2. Select a record and added a date in 908$a using default format e.g. 02/02/2023 (for example record 1) 3. Select another record and added a date in 908$a using ISO format e.g. 2023-04-01 (for example record 262) 4. Applied the patch. 5. Ran these examples, including output from change: - perl misc/add_date_fields_to_marc_records.pl --field='905$a=0/%Y' --field='905$a=1/%Y/%b-%m' --field='905$a=2/%Y/%b-%m/%d' --unless-exists='905$a' --where "biblionumber=1" --date-field='908$a' --verbose --confirm 02/02/2023 at misc/add_date_fields_to_marc_records.pl line 82. The following MARC fields will be added to record 1: 905 _a0/2023 905 _a1/2023/Feb-02 905 _a2/2023/Feb-02/02 Bibliographic record 1 has been modified - perl misc/add_date_fields_to_marc_records.pl --field='905$a=0/%Y' --field='905$a=1/%Y/%b-%m' --field='905$a=2/%Y/%b-%m/%d' --unless-exists='905$a' --where "biblionumber=262" --date-field='908$a' --verbose --confirm 2023-04-01 at misc/add_date_fields_to_marc_records.pl line 82. The following MARC fields will be added to record 262: 905 _a0/2023 905 _a1/2023/Apr-04 905 _a2/2023/Apr-04/01 Bibliographic record 262 has been modified I hope that is sufficent to test! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |master QA Contact|testopia@bugs.koha-communit |katrin.fischer@bsz-bw.de |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 --- Comment #12 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- What I did (and please provide test plans yourself...): 1) Updated dateformat to DD.MM.YYYY 2) Added 505$a 01.01.2024 to a record 3) Ran: ./misc/add_date_fields_to_marc_records.pl --field='505$g=0/%Y' --date-field='505$a' --verbose --confirm 505$g was created. In my tests it seems like --unless-exists='505$g' didn't have any effect, but that is out of scope here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 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=23924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149739|0 |1 is obsolete| | --- Comment #13 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 150131 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150131&action=edit Bug 23924: Add --date-field to add_date_fields_to_marc_records.pl The date used in the script will use this parameter, instead of today. Test plan: Use the POD of the script to understand how this flag works. Then use the script to create fields with a date contained in a specific MARC field. Signed-off-by: Hugo Agud <hagud@orex.es> Signed-off-by: David Nind <david@davidnind.com> 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=23924 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149740|0 |1 is obsolete| | --- Comment #14 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 150132 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150132&action=edit Bug 23924: Reset the fields to add We do not want to copy fields from the previous records! Signed-off-by: David Nind <david@davidnind.com> 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=23924 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to master Version(s)| |23.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=23924 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@ptfs-europe | |.com Status|Pushed to master |Needs documenting --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, no backport for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23924 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|martin.renvoize@ptfs-europe | |.com | -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org