Bug 17672 - Items table should have a damaged_on column
Summary: Items table should have a damaged_on column
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-23 14:31 UTC by Nick Clemens
Modified: 2018-03-23 00:54 UTC (History)
4 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17672 - Items table should have a damaged_on column (8.59 KB, patch)
2017-07-19 13:15 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 17672 - Schema updates (2.90 KB, patch)
2017-07-19 13:16 UTC, Nick Clemens
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17672 - Items table should have a damaged_on column (8.65 KB, patch)
2017-08-07 13:42 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17672 - Schema updates (2.96 KB, patch)
2017-08-07 13:42 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17672 - Items table should have a damaged_on column (8.62 KB, patch)
2017-11-03 20:25 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17672 - Schema updates (3.00 KB, patch)
2017-11-03 20:25 UTC, Charles Farmer
Details | Diff | Splinter Review
Bug 17672 - Dumping Items.t expected tests from 12 to 13 (626 bytes, patch)
2017-11-03 20:25 UTC, Charles Farmer
Details | Diff | Splinter Review
k (1.18 KB, patch)
2018-02-18 17:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17672: Add damaged_on to items and deleteditems tables (8.75 KB, patch)
2018-02-18 17:18 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17672: Fixing Items.t expected tests from 12 to 13 (700 bytes, patch)
2018-02-18 17:18 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2016-11-23 14:31:26 UTC
Mirroring the itemlost_on column it would be nice to have the ability to see when an item was marked damaged so libraries can track repairs and mending.
Comment 1 Nick Clemens 2017-07-19 13:15:58 UTC
Created attachment 65099 [details] [review]
Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t
Comment 2 Nick Clemens 2017-07-19 13:16:01 UTC
Created attachment 65100 [details] [review]
Bug 17672 - Schema updates
Comment 3 Owen Leonard 2017-08-01 12:46:12 UTC
I haven't seen how withdrawn_on and itemlost_on behave, but I would think it could be useful to store the date the status was changed no matter what it changed to. Why not store the date if you're setting it to 0?
Comment 4 Nick Clemens 2017-08-07 12:21:16 UTC
(In reply to Owen Leonard from comment #3)
> I haven't seen how withdrawn_on and itemlost_on behave, but I would think it
> could be useful to store the date the status was changed no matter what it
> changed to. Why not store the date if you're setting it to 0?

I think this would be a change in behaviour - currently these or more like the onloan column - info if the criteria is met, blank otherwise. Changing this would impact reports etc. 

I do think it would be a good change, but should be on a new bug
Comment 5 Owen Leonard 2017-08-07 13:42:23 UTC
Created attachment 65551 [details] [review]
[SIGNED-OFF] Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 6 Owen Leonard 2017-08-07 13:42:25 UTC
Created attachment 65552 [details] [review]
[SIGNED-OFF] Bug 17672 - Schema updates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 7 Charles Farmer 2017-11-03 20:17:15 UTC
Since we see the date at which the item was damaged on the moredetail.pl, should we also see this information in the header table of the additem.pl page along the status? Just pitching the idea out there.

Everything worked fine, though I had to bump up the number of tests from 12 to 13 in order to make it work on the current master.
Comment 8 Charles Farmer 2017-11-03 20:25:15 UTC
Created attachment 68937 [details] [review]
Bug 17672 - Items table should have a damaged_on column

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 9 Charles Farmer 2017-11-03 20:25:30 UTC
Created attachment 68938 [details] [review]
Bug 17672 - Schema updates

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Comment 10 Charles Farmer 2017-11-03 20:25:36 UTC
Created attachment 68939 [details] [review]
Bug 17672 - Dumping Items.t expected tests from 12 to 13
Comment 11 Katrin Fischer 2018-02-18 15:22:00 UTC
Hi Tomas, started on this one not noticing your QA contact at first then saw it's from December. Grabbing this one :)
Comment 12 Katrin Fischer 2018-02-18 17:17:50 UTC
Created attachment 71912 [details] [review]
k
Comment 13 Katrin Fischer 2018-02-18 17:18:39 UTC
Created attachment 71913 [details] [review]
Bug 17672: Add damaged_on to items and deleteditems tables

This patchset adds a 'damaged_on' column to store the date an item is
marked damaged, analogous to withdrawn_on and itemlost_on

To test:
1 - Apply patch
2 - Mark an item damaged via moredetail.pl (Items tab on left in
        details)
3 - Note the damaged on date apears below
4 - Unmark the item, the date is removed
5 - Go to the edit items screen (from top bar 'Edit->edit items')
6 - Mark item damaged - check db or moredetails.pl to see damaged_on
date
7 - Unmark item damaged - confirm date is removed
8 - prove t/db_dependent/Items.t

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2018-02-18 17:18:59 UTC
Created attachment 71914 [details] [review]
Bug 17672: Fixing Items.t expected tests from 12 to 13

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2018-02-18 17:20:10 UTC
Works nicely, QA tools and tests pass :)

I fixed patch subjects and changed the database update message a little to describe the change.
Comment 16 Jonathan Druart 2018-02-18 19:49:30 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 17 Jonathan Druart 2018-02-19 20:33:03 UTC
It broke the misc4dev tools:
C4::Installer::load_sql returned the following errors while attempting to load /home/vagrant/misc4dev/data/sql/marc21/1611/after_17196/items.sql:
DBD::mysql::st execute failed: Column count doesn't match value count at row 1 at /usr/share/perl5/DBIx/RunSQL.pm line 273.
Comment 18 Nick Clemens 2018-02-20 12:02:17 UTC
(In reply to Jonathan Druart from comment #17)
> It broke the misc4dev tools:
> C4::Installer::load_sql returned the following errors while attempting to
> load /home/vagrant/misc4dev/data/sql/marc21/1611/after_17196/items.sql:
> DBD::mysql::st execute failed: Column count doesn't match value count at row
> 1 at /usr/share/perl5/DBIx/RunSQL.pm line 273.

Doesn't this mean misc4dev needs an update? Not sure what is needed here
Comment 19 Tomás Cohen Arazi 2018-02-20 12:08:42 UTC
(In reply to Nick Clemens from comment #18)
> (In reply to Jonathan Druart from comment #17)
> > It broke the misc4dev tools:
> > C4::Installer::load_sql returned the following errors while attempting to
> > load /home/vagrant/misc4dev/data/sql/marc21/1611/after_17196/items.sql:
> > DBD::mysql::st execute failed: Column count doesn't match value count at row
> > 1 at /usr/share/perl5/DBIx/RunSQL.pm line 273.
> 
> Doesn't this mean misc4dev needs an update? Not sure what is needed here

I think Jonathan is asking you to provide a fix for misc4dev he.
Comment 20 Jonathan Druart 2018-02-20 14:43:13 UTC
(In reply to Tomás Cohen Arazi from comment #19)
> I think Jonathan is asking you to provide a fix for misc4dev he.

Nope, I would have asked explicitly in that case :)
I let a note here to let you know and added a keyword to not forget.
Comment 21 Jonathan Druart 2018-02-20 14:55:17 UTC
New commit added to misc4dev.

  commit 05f342d6a850e2a89b2d49a9ce1bcb35c411d787

    Fix items.sql since bug 17672

    damaged_on has been added and so we must list the columns
Comment 22 Nick Clemens 2018-03-23 00:54:39 UTC
Enhancement, not backported for 17.11