Bug 5423

Summary: Deleted Patrons are no longer saved in table deletedborrowers
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: DatabaseAssignee: Katrin Fischer <katrin.fischer>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: blocker    
Priority: PATCH-Sent (DO NOT USE) CC: chris, kmkale, nengard
Version: rel_3_2   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed patch, written for and tested with HEAD
Proposed patch, written for and tested with 3.2.x
Patch for 3.2
Revised patch.

Description Katrin Fischer 2010-11-21 01:40:33 UTC
There are structural differences between borrowers and deletedborrowers. 

- cardnumber varchar(16) vs. varchar(9)
- privacy column is missing from deletedborrowers

koha-error-log message after successfully(!) deleting a borrower:

[Sun Nov 21 01:57:45 2010] [error] [client ::1] [Sun Nov 21 01:57:45 2010] deletemem.pl: DBD::mysql::st execute failed: Column count doesn't match value count at row 1 at /home/katrin/kohaclone/C4/Members.pm line 1610., referer: http://localhost:8080/cgi-bin/koha/members/moremember.pl?borrowernumber=5

The data of the deleted borrower is not saved to the table deletedborrowers.

I am going to send a patch to update the database and resolve the differences between the tables.
Comment 1 Katrin Fischer 2010-11-21 02:04:51 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2010-11-21 02:34:11 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2010-12-06 06:54:18 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2010-12-06 12:46:56 UTC
Created attachment 2804 [details] [review]
Revised patch.

Slightly revised patch for 3.2 and HEAD - signed off by Koustubha Kale.
Comment 5 Koustubha Kale 2010-12-06 12:51:21 UTC
Works as promised. Tested with HEAD

On Mon, Dec 6, 2010 at 12:58 PM, Katrin Fischer wrote:
> Should also apply to 3.2.x

( Not tested with 3.2.x)
Comment 6 MJ Ray (software.coop) 2010-12-08 10:15:50 UTC
This bug is mentioned in:
Bug 5423: Deleted Patrons are no	longer saved in table deletedborrowers http://lists.koha-community.org/pipermail/koha-patches/2010-November/013084.html
Bug 5423: Deleted Patrons are no	longer saved in table deletedborrowers http://lists.koha-community.org/pipermail/koha-patches/2010-November/013085.html
Comment 7 Chris Cormack 2010-12-12 20:24:02 UTC
Pushed to master please test
Comment 8 Katrin Fischer 2010-12-13 21:24:29 UTC
Works in HEAD. Leaving bug open until pushed and tested in 3.2.1.
Comment 9 Katrin Fischer 2010-12-13 21:35:08 UTC
Applied to HEAD, fixed a small error in template, signed-off and resent.
Comment 10 Katrin Fischer 2010-12-13 21:35:26 UTC
Too many tabs... ignore previous comment.
Comment 11 Nicole C. Engard 2010-12-14 15:55:22 UTC
I do have a privacy column in my deleted borrowers table (in HEAD) and I have no errors in my log on deleting a patron.

Here's my table:


mysql> select * from deletedborrowers;
+----------------+----------------+---------+-----------+-------+------------+----------+--------------+------------+------------------+----------+-----------------+---------+---------+-------+----------------+--------+------+----------+----------+----------------+--------------+-----------+------------+--------+-----------+-----------+---------+---------+-------------+------------+--------------+--------------+------------+---------------+------+----------+-------------+------------------+--------------+-------------+---------------+--------------+-----------+----------+------+------------------+-------+----------------+----------+-------------+------------------+-------+---------------------+-------------------+--------------------+--------------------+--------------------+-------------------+-------------------+-----------------+----------------+---------+
| borrowernumber | cardnumber     | surname | firstname | title | othernames | initials | streetnumber | streettype | address          | address2 | city            | zipcode | country | email | phone          | mobile | fax  | emailpro | phonepro | B_streetnumber | B_streettype | B_address | B_address2 | B_city | B_zipcode | B_country | B_email | B_phone | dateofbirth | branchcode | categorycode | dateenrolled | dateexpiry | gonenoaddress | lost | debarred | contactname | contactfirstname | contacttitle | guarantorid | borrowernotes | relationship | ethnicity | ethnotes | sex  | password         | flags | userid         | opacnote | contactnote | sort1            | sort2 | altcontactfirstname | altcontactsurname | altcontactaddress1 | altcontactaddress2 | altcontactaddress3 | altcontactzipcode | altcontactcountry | altcontactphone | smsalertnumber | privacy |
+----------------+----------------+---------+-----------+-------+------------+----------+--------------+------------+------------------+----------+-----------------+---------+---------+-------+----------------+--------+------+----------+----------+----------------+--------------+-----------+------------+--------+-----------+-----------+---------+---------+-------------+------------+--------------+--------------+------------+---------------+------+----------+-------------+------------------+--------------+-------------+---------------+--------------+-----------+----------+------+------------------+-------+----------------+----------+-------------+------------------+-------+---------------------+-------------------+--------------------+--------------------+--------------------+-------------------+-------------------+-----------------+----------------+---------+
|             37 | 23529000197047 | Charles | Lisa      |       |            |          | NULL         | NULL       | 5129 Library Rd. | NULL     | Centerville, CA | 44262   | NULL    | NULL  | (212) 555-1212 | NULL   | NULL | NULL     | NULL     | NULL           | NULL         |           | NULL       |        |           | NULL      |         |         | 1982-10-14  | MPL        | K            | 1988-11-14   | 2020-12-31 |             0 |    0 |        0 | Alford      | Jordan           | NULL         |          45 |               | father       | NULL      | NULL     | M    | 42b29d0771f3b7ef |  NULL | 23529000197047 |          |             | 0.26352253767058 | Y     |                     |                   |                    |                    |                    |                   | NULL              |                 | NULL           |       1 |

1 row in set (0.00 sec)
Comment 12 Nicole C. Engard 2010-12-14 15:58:04 UTC
oops we all missed that the patch has been pushed :) ignore my notes
Comment 13 MJ Ray (software.coop) 2011-01-04 10:25:07 UTC
This bug is mentioned in:
Bug 5423: Deleted Patrons are no longer	saved in table deletedborrowers http://lists.koha-community.org/pipermail/koha-patches/2010-December/013168.html
Comment 14 Katrin Fischer 2011-03-06 20:16:17 UTC
Successfully tested on master and 3.2.x with fresh databases.