Bug 32456 - Date accessioned is now cleared when items are replaced
Summary: Date accessioned is now cleared when items are replaced
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
: 32451 (view as bug list)
Depends on: 29958
Blocks:
  Show dependency treegraph
 
Reported: 2022-12-13 14:23 UTC by Nick Clemens (kidclamp)
Modified: 2023-12-28 20:42 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.02,22.05.09
Circulation function:


Attachments
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.61 KB, patch)
2022-12-13 14:27 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.67 KB, patch)
2022-12-14 20:21 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.74 KB, patch)
2022-12-16 07:37 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32456: Unit tests (1.99 KB, patch)
2022-12-16 15:48 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.74 KB, patch)
2022-12-16 15:48 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 32456: Unit tests (2.06 KB, patch)
2022-12-20 14:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.74 KB, patch)
2022-12-20 14:54 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32456: Preserve date accessioned if a date is not explicitly passed (1.80 KB, patch)
2022-12-27 13:48 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2022-12-13 14:23:56 UTC
Bug 29958 changed item edits so that a blank date accessioned would not auto populate. This broke workflows for libraries who have vendors processing their item records. 

When a library imports the final records, the date accessioned is not included, as the vendor doesn't know the date, and existing date is now blanked.

I believe we should preserve the date accessioned unless the file includes a new one.
Comment 1 Nick Clemens (kidclamp) 2022-12-13 14:27:22 UTC
Created attachment 144553 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field
Comment 2 Andrew Fuerste-Henry 2022-12-14 20:21:41 UTC
Created attachment 144593 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Comment 3 Martin Renvoize (ashimema) 2022-12-16 07:37:48 UTC
Created attachment 144637 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2022-12-16 07:39:22 UTC
This works as described and I believe resolves a regression without causing further issues with the feature that introduced the regression.

I'd love to see a Unit Test though so we don't risk regressing again?
Comment 5 Nick Clemens (kidclamp) 2022-12-16 15:48:23 UTC
Created attachment 144692 [details] [review]
Bug 32456: Unit tests
Comment 6 Nick Clemens (kidclamp) 2022-12-16 15:48:27 UTC
Created attachment 144693 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize (ashimema) 2022-12-20 14:54:54 UTC
Created attachment 144740 [details] [review]
Bug 32456: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize (ashimema) 2022-12-20 14:54:58 UTC
Created attachment 144741 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize (ashimema) 2022-12-20 14:55:26 UTC
Works well, resolves the regression.

Passing QA
Comment 10 Tomás Cohen Arazi (tcohen) 2022-12-27 13:48:06 UTC
Created attachment 144851 [details] [review]
Bug 32456: Preserve date accessioned if a date is not explicitly passed

To test:
 1 - Edit an item record to have a blank date accessioned
 2 - Save the record as marcxml from the detail page
 3 - Edit the item to have an accession date
 4 - Stage and import the file - matching in KohaBiblio and replacing items
 5 - Import the file
 6 - Confirm the date accessioned is cleared
 7 - Apply patch
 8 - Provide an accession date for the item
 9 - Stage and import the file again
10 - Confirm the date remained
11 - Edit the item to remove the date
12 - Confirm you can manually blank the field

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 11 Tomás Cohen Arazi (tcohen) 2022-12-27 14:09:39 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 12 Jacob O'Mara 2023-01-13 11:55:46 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 13 Lucas Gass (lukeg) 2023-01-19 23:56:07 UTC
Backported to 22.05.x for upcoming 22.05.09
Comment 14 Arthur Suzuki 2023-01-26 11:10:30 UTC
patch conflicts + new tests are failing on 21.11.x.
won't backport.
Comment 15 Lisette Scheer 2023-03-30 21:46:39 UTC
*** Bug 32451 has been marked as a duplicate of this bug. ***