Koha/C4
Marcel de Rooy 137cbd8d09 Bug 17512: Improve handling dates in C4::Items
This is a follow-up on the internal server error on 0000-00-00 in the items
column onloan. This patch deals with preventing to have such dates at all
in the date fields of items.

It is accomplished by:
[1] Adding a (private) subroutine _mod_item_dates. It takes an item hash
    and replaces date values if needed.
[2] AddItem and ModItem call _koha_new_item resp. koha_modify_item. In these
    routines a call to the new _mod_item_dates is inserted.
[3] Although the routine is actually private, I have added some unit tests
    to Items.t.

Test plan:
[1] Add a new item. Fill a correct date in dateaccessioned and an invalid
    date in Price effective from (=replacementpricedate).
[2] Verify that dateaccessioned is saved correctly and replacementpricedate
    is still null (does not contain 0000-00-00).
[3] Edit the item again. Fill some text in dateaccessioned and put a correct
    date in replacementpricedate. Verify the results.
[4] Run t/db_dependent/Items.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
2017-02-14 13:57:49 +00:00
..
AuthoritiesMarc
Barcodes Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead 2016-09-13 17:21:05 +00:00
ClassSortRoutine
Creators Bug 18044: Label Batches not displaying 2017-02-07 17:46:00 +00:00
External Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Form
Heading
ILSDI Bug 17836: (ILSDI) Make GetPatronInfo fill 'charges' correctly 2017-01-20 13:44:56 +00:00
Installer Bug 17986: Perl dependency evaluation incorrect 2017-01-30 11:18:27 +00:00
Labels Bug 15758: Koha::Libraries - Remove GetBranchName 2016-09-08 14:36:01 +00:00
Linker
Members Bug 10227 : Fix GetMessagingPreferences when digest is possible 2016-09-13 17:14:28 +00:00
OAI
Output
Patroncards
Reports Bug 17535: Fix search for reports by keywords 2016-11-07 16:38:25 +00:00
Search Bug 17323: Column search_history.time cannot be null 2016-11-18 13:51:37 +00:00
Serials
SIP Bug 17196: Move marcxml out of the biblioitems table 2017-01-13 13:49:26 +00:00
Utils Bug 17588: ->get_issues has been replaced with ->checkouts 2017-01-20 14:25:35 +00:00
Accounts.pm Bug 17894 - Remove and replace WriteOffFee 2017-01-19 11:15:26 +00:00
Acquisition.pm Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
Auth.pm Bug 9569: Security patch for AutoLocation 2017-01-30 11:25:06 +00:00
Auth_cas_servers.yaml.sample Bug 17065 - Rename C4/Auth_cas_servers.yaml.orig 2016-08-08 13:16:36 +00:00
Auth_with_cas.pm Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication) 2016-11-07 16:34:57 +00:00
Auth_with_ldap.pm Bug 17775 - Add new user with LDAP not works under Plack 2017-02-07 17:45:13 +00:00
Auth_with_shibboleth.pm Bug 16818: External auth redirect broken under Plack 2016-08-04 19:42:44 +00:00
AuthoritiesMarc.pm Bug 17913: [Follow-up] Fix duplicate $9s after merging in loose mode 2017-01-20 13:55:13 +00:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 17196: [QA Follow-up] Adjust some text on marcxml 2017-01-13 13:49:30 +00:00
Bookseller.pm Bug 13726: Make Koha::Acq::Bookseller using Koha::Object 2016-12-30 11:54:32 +00:00
Boolean.pm
Breeding.pm
Budgets.pm Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order 2016-10-28 15:26:00 +00:00
Calendar.pm Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Charset.pm
Circulation.pm Bug 16387: Fix default shortened loan period time 2017-02-07 17:54:21 +00:00
ClassSortRoutine.pm
ClassSource.pm Bug 17208: Checking if classification source or filing rule already exists before adding 2016-12-23 11:33:48 +00:00
Context.pm Bug 17486: [QA Follow-up] Changes as to set_userenv 2017-01-13 12:32:20 +00:00
Contract.pm
CourseReserves.pm
Creators.pm
Debug.pm
Heading.pm
HoldsQueue.pm Bug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other 2016-10-11 15:44:47 +00:00
HTML5Media.pm Bug 17501: Remove Koha::Upload::get from Koha::Upload 2017-01-20 14:20:05 +00:00
Images.pm
ImportBatch.pm Bug 6852: Staged import reports wrong success for items 2016-09-12 08:55:41 +00:00
ImportExportFramework.pm Bug 17389: Clear logs 2016-10-11 16:18:10 +00:00
InstallAuth.pm
Installer.pm Bug 17234: Need to separate KEY and FOREIGN KEY checks 2017-01-12 12:43:10 +00:00
ItemCirculationAlertPreference.pm Bug 15407: Koha::Patron::Categories - replace C4::Category->all 2016-09-08 13:29:03 +00:00
Items.pm Bug 17512: Improve handling dates in C4::Items 2017-02-14 13:57:49 +00:00
Koha.pm Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories 2016-10-28 16:35:52 +00:00
Labels.pm
Languages.pm Bug 16770: Remove wrong caching of 3 subroutines in C4::Lancuages 2016-06-24 14:05:56 +00:00
Letters.pm Bug 17904: Fix possible SQL injection in late orders 2017-01-30 11:22:33 +00:00
Linker.pm
Log.pm Bug 14642: Add logging for Holds 2016-08-17 18:43:13 +00:00
MarcModificationTemplates.pm
Matcher.pm Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher 2016-10-28 11:58:14 +00:00
Members.pm Bug 17588: Koha::Patrons - Move GetMemberIssuesAndFines 2017-01-20 14:25:34 +00:00
Message.pm
NewsChannels.pm
Output.pm
Overdues.pm Bug 17196: Move marcxml out of the biblioitems table 2017-01-13 13:49:26 +00:00
Patroncards.pm
Print.pm
Record.pm Bug 17196: [QA Follow-up] Adjust some text on marcxml 2017-01-13 13:49:30 +00:00
Reports.pm
Reserves.pm Bug 18015 - On shelf holds allowed > "If all unavailable" ignores notforloan 2017-02-07 17:51:51 +00:00
Ris.pm Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel 2016-10-21 14:51:55 +00:00
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 17764: (bug 17556 follow-up) Fix search for logged out users and lost items 2016-12-22 20:25:05 +00:00
Serials.pm Bug 17902: Follow-up fixing SQL statement 2017-01-30 13:02:57 +00:00
Service.pm
ShelfBrowser.pm Bug 15758: Koha::Libraries - Remove GetBranches 2016-09-08 14:36:03 +00:00
SMS.pm Bug 13029 : Follow up 2016-12-16 11:33:39 +00:00
SocialData.pm
Stats.pm
Suggestions.pm
Tags.pm Bug 16637: Dependency for C4::Tags not listed 2016-06-10 18:05:10 +00:00
Templates.pm
TmplToken.pm
TmplTokenType.pm
TTParser.pm
UsageStats.pm Bug 15131: Add AllowItemsOnHoldCheckoutSCO to UsageStats 2016-10-21 17:27:07 +00:00
XISBN.pm
XSLT.pm Bug 17642: Add and use get_descriptions_by_koha_field 2016-11-18 15:52:00 +00:00