Koha-clms/t/db_dependent
Jonathan Druart 2d583678aa Bug 6756: Fix bad behaviors if AnonymousPatron is not defined
There are at least 2 wrong behaviors if the AnonymousPatron pref is not
defined (0 or empty string).
1/ If you use the clean borrower tools, you will get a successful
message when the nothing happened (the history has not been anonymised).
2/ At the OPAC, if a patron ask for delete his reading history, he will
get an error message "The deletion of your reading history failed,
because there is a problem with the configuration of this feature.
Please help to fix the system by informing your libr    ary of this
error". IMO this should not happen, the history should be anonymised.

With this patch, the old_issues.borrowernumber field will be set to NULL
if the AnonymousPatron pref if not defined.

Test plan:
1/ Fill the pref with "" or 0
2/ At the OPAC, go on the privacy tab and click on the "Immedia deletion" button.
You should get a green and friendly message. Confirm that the history
has been anonymised.
3/ Use the "Batch patron anonymization" tools (tools/cleanborrowers.pl)
to anonymize the checkout history.
Confirm that a) it works and b) you get a message.

Try again with AnonymousPatron set to a valid patron. You should not see
any changes with the current behaviors.

NOTE: This patch tweaks C4/Circulation.pm and provides tests.
      applying just this, and running prove success. Reverting just
      C4/Circulation.pm fails, as expected.
      Tested OPAC stuff with both patches applied.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
(cherry picked from commit 224b1c7976)
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
(cherry picked from commit 085272aec0)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
2015-09-23 12:08:09 +12:00
..
Acquisition Bug 13319: Fix Koha::Acq::Order should set parent_ordernumber 2015-02-14 20:26:53 +13:00
Circulation Bug 6756: Fix bad behaviors if AnonymousPatron is not defined 2015-09-23 12:08:09 +12:00
Holds Bug 11126: (RM followup) remove diags from tests 2014-11-04 18:59:42 -03:00
Items Bug 8723: Update the reserves table for item-level holds 2015-09-23 11:28:05 +12:00
Koha Bug 11425: Add unit tests 2014-11-04 19:10:28 -03:00
LDAP
…
Labels Bug 14204: (QA followup) remove unneeded messages 2015-05-18 11:26:34 +12:00
Letters Bug 13215: Fix GetLetterTemplates should return default templates if branchcode is not defined 2014-11-27 11:42:26 -03:00
Members Bug 12847: Items issued today is considered as overdue 2015-04-22 18:05:48 +12:00
Record Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Reports Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Search Bug 10807: Add an authority search history for the OPAC 2014-05-05 02:32:27 +00:00
Serials Bug 13456: Serials/Claims.t expects no subscriptions 2014-12-20 12:55:01 +13:00
Utils Bug 14782: Add tests 2015-09-23 11:21:17 +12:00
XSLT_Handler Bug 6536: QA Follow-up: Add some unit tests for Z3950Search in Breeding.pm 2014-09-01 10:09:17 -03:00
data Bug 12419: (QA followup) regression tests 2014-06-30 15:57:23 -03:00
www Bug 13579: Prefer like instead of ok to match a regex 2015-01-18 14:56:59 +13:00
00-strict.t Bug 7844: (follow-up) don't test koha.psgi for ability to compile (yet) 2014-04-29 19:34:23 +00:00
Accounts.t
…
Acquisition.t Bug 12980: GetHistory does useless processing 2014-12-04 09:02:49 +13:00
Amazon.t
…
Auth.t Bug 11349: Change .tmpl -> .tt in scripts using templates 2014-07-17 11:05:49 -03:00
Auth_with_cas.t Bug 12398: (followup) tidy unit tests 2014-08-01 10:13:45 -03:00
Auth_with_ldap.t Bug 12831: (RM followup) regression test 2014-11-27 14:45:11 -03:00
AuthoritiesMarc.t Bug 10985: [UNIMARC] Fix authority summary 2015-05-01 20:08:13 +12:00
BackgroundJob.t
…
Barcodes.t
…
Biblio.t Bug 10961: (followup) Make query fields explicit and add regression tests 2015-08-11 13:53:06 +12:00
Bookseller.t Bug 12830: Move the order-related code into Koha::Acquisition::Order 2014-10-28 11:10:36 -03:00
Borrower_Debarments.t Bug 12416: add new tests of DelUniqueDebarment 2014-06-22 19:59:04 -03:00
Borrower_Files.t Bug 12417: adding the units tests of the module Koha::Borrower::Files.pm 2014-07-11 16:16:11 -03:00
Branch.t Bug 9530: Follow-up - Fix t/db_dependent/Branch.t 2014-10-28 09:26:03 -03:00
Breeding.t Bug 12898: (regression test) test terms inside double quotes 2014-09-14 02:02:51 -03:00
Budgets.t Bug 12958: Set a fund owner to a fund hierarchy 2014-10-31 16:18:49 -03:00
Category.t Bug 11543: (followup) add one more test 2014-01-15 19:58:30 +00:00
Charset.t Bug 8218 : Add a maintenance script to sanitize biblio records 2014-11-11 15:38:36 -03:00
Circulation.t Bug 14470: Do not allow renew for on-site checkouts 2015-09-23 10:40:00 +12:00
Circulation_Branch.t
…
Circulation_Issuingrule.t Bug 11577 : Fixing a tiny copy/paste issue 2014-09-17 19:23:37 -03:00
Circulation_OfflineOperation.t
…
Circulation_issue.t Bug 13315: (QA followup) fix t/db_dependent/Circulation_issue.t 2015-04-30 09:42:53 +12:00
Circulation_issuingrules.t Bug 11934: (follow-up) tidy up whitespace 2014-03-13 15:18:49 +00:00
Circulation_transfers.t
…
ClassSource.t
…
ColumnsSettings.t Bug 10212: Columns configuration for tables - Unit tests 2014-08-26 09:28:18 -03:00
Context.t Bug 12808: remove useless diags from t/db_dependent/Context.t 2014-08-26 10:30:53 -03:00
Contract.t Bug 12487: SQLHelper replacement - C4::Contract 2014-07-30 10:44:11 -03:00
CourseReserves.t
…
Csv.t
…
External_BakerTaylor.t
…
Heading_MARC21.t
…
Holds.t Bug 13075: (followup) remove remaining warnings 2014-11-14 09:35:50 -03:00
HoldsQueue.t Bug 11258: fix another case where holds queue made transfer requests that contradict the library holds policy 2014-04-18 15:23:23 +00:00
Holidays.t Bug 13451: Holidays.t assumes default data 2014-12-18 13:08:43 +13:00
ILSDI_Services.t Bug 11891: set up tests to require that Koha::Database uses same DB handle as C4::Context 2014-06-19 11:54:45 -03:00
ImportBatch.t Bug 6520: Add unit test for C4::ImportBatch::GetRecordFromImportBiblio 2015-04-22 11:07:19 +12:00
Installer.t Bug 11541: (follow-up) move Installer.t to t/db_dependent 2014-01-14 21:43:56 +00:00
Items.t Bug 13562: Fix item search on item MARC subfields 2015-02-13 10:43:45 +13:00
Items_DelItem.t Bug 12583: (followup) rename new test file 2014-07-26 10:17:09 -03:00
KitchenSinkPlugin.kpz
…
Koha.t Bug 13453: Koha.t daily quote tests assume sample data 2014-12-30 10:32:36 +13:00
Koha_Authority.t Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Koha_Database.t Bug 13645: Cache the DBIx connection 2015-03-11 07:56:01 +13:00
Koha_Misc_Files.t Bug 3050: QA follow-up 2014-05-25 21:15:03 +00:00
Koha_borrower_modifications.t Bug 12623: SQLHelper replacement - Borrower::Modifications 2014-08-11 11:42:58 -03:00
Koha_template_plugin_Branches.t Bug 11779: (follow-up) improve GetLoggedInBranchcode() and add test cases 2014-02-19 16:40:06 +00:00
Koha_template_plugin_KohaDates.t Bug 12669: Centralize the timezone handle into Koha::DateUtils 2015-02-23 12:06:38 +13:00
Languages.t Bug 7841: add a direct regression test 2014-05-19 16:40:23 +00:00
Letters.t Bug 14206: Adds test for getletter() call from overdue_notices.pl 2015-06-16 13:38:10 +12:00
Linker_FirstMatch.t
…
Log.t
…
MarcModificationTemplates.t Bug 11413: Fix field_numbers 2014-11-14 12:05:47 -03:00
Members.t Bug 12868: Improving t/db_dependent/Member.t 2015-01-15 13:36:34 +13:00
Members_Attributes.t Bug 12427: Allow execution of UTs on a DB with issues 2014-06-24 09:43:04 -03:00
Members_columns.t
…
MungeMarcPrice.t Bug 9593: (follow-up) don't make currency.isocode required 2014-05-04 22:21:17 +00:00
NewsChannels.t Bug 7567: (follow-up) make tests of get_opac_new more readable 2014-04-07 18:14:20 +00:00
Overdues.t Bug 9180: All branches should be returned if a default rule exists 2014-08-19 09:29:51 -03:00
PatronLists.t
…
Plugins.t
…
QueryParser.t Bug 12738: (regression tests) C4::Context should set keyword search as default for QueryParser 2014-08-11 10:05:59 -03:00
Ratings.t Bug 12609: Add some unit tests for C4::Ratings 2014-09-17 22:08:57 -03:00
Record.t Bug 11826: Use XSLT handler object in showmarc, Record.pm 2014-05-26 03:52:45 +00:00
RecordProcessor_EmbedSeeFromHeadings.t Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-22 11:28:36 +12:00
Reports.t
…
ReportsGuided.t Bug 13141: (QA Followup) Update number of unit tests 2014-10-31 13:15:06 -03:00
Reports_Guided.t Bug 11672: (followup) warnings tested 2014-09-23 15:32:28 -03:00
Reserves.t Bug 13116 - Make it possible to propagate errors from C4::Reserves::CanItemBeReserved() to the web-templates. 2014-11-12 11:23:41 -03:00
RotatingCollections.t Bug 8836: (RM followup) unit tests should use the new API 2014-11-07 11:09:14 -03:00
SIP_ILS.t Bug 7904: (QA followup) fix tests 2015-05-21 10:24:38 +12:00
SQLHelper.t Bug 11425: (followup) fix number of tests 2014-11-04 19:20:34 -03:00
Search.t Bug 13088: (RM followup) add missing pref mock 2014-10-28 12:07:46 -03:00
Search_SearchHistory.t Bug 10807: (follow-up) remove comment about routine that is no longer present 2014-05-05 02:58:29 +00:00
Serials.t Bug 13423: Fix number of tests in Serials.t 2015-05-18 11:16:37 +12:00
Serials_2.t Bug 5342: Serial claiming improvements: add a counter 2014-10-28 10:07:37 -03:00
Service.t
…
ShelfBrowser.t
…
Stats.t Bug 11230 - Refactor C4::Stats::UpdateStats and add UT 2014-07-27 11:29:28 -03:00
SuggestionEngine_ExplodedTerms.t Bug 12653: remaining prog reference in t/db_dependent/SuggestionEngine_ExplodedTerms.t 2014-10-29 23:37:54 -03:00
Suggestions.t Bug 13457 - Followup for CPL and S codes 2015-02-10 10:48:36 +13:00
Tags.t Bug 12916 - Missing Test to demonstrate warnings. 2014-10-30 00:31:26 -03:00
Templates.t Bug 12918: fix failing test case 2014-09-15 10:53:00 -03:00
UploadedFile.t
…
VirtualShelves.t Bug 9032: (follow-up) restore documented intepretation of virtualshelfshares.sharedate 2014-04-20 22:52:21 +00:00
VirtualShelves_Page.t
…
XISBN.t Bug 12782: (followup) skip tests that fail because of provider's error 2014-08-20 12:29:27 -03:00
XSLT_Handler.t Bug 11826: Add unit tests for Koha::XSLT_Handler 2014-05-26 03:52:45 +00:00
check_sysprefs.t
…
default_search_class.pl Bug 12738: (regression tests) C4::Context should set keyword search as default for QueryParser 2014-08-11 10:05:59 -03:00
rollingloans.t Bug 13315 - Add feedback for last item checked out to circulation.pl 2015-04-30 09:40:49 +12:00
sysprefs.t
…
zebra_config.pl Bug 12651: DOM indexing is the default 2014-10-27 12:35:44 -03:00