Bug 12874

Summary: On editing an item, some fields can be set to NULL
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: CatalogingAssignee: Galen Charlton <gmcharlt>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: m.de.rooy, nick, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7817
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12817
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12818
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 13074, 13465, 16428    
Attachments: Bug 12874: A DB field without a default mapping is set to a default value on editing
Bug 12874: A DB field without a default mapping is set to a default value on editing
[SIGNED OFF] Bug 12874: A DB field without a default mapping is set to a default value on editing
[PASSED QA] Bug 12874: A DB field without a default mapping is set to a default value on editing

Description Jonathan Druart 2014-09-04 14:47:11 UTC
This bug report follows bug 7817, refer to it for more details.
Comment 1 Jonathan Druart 2014-09-04 14:47:41 UTC Comment hidden (obsolete)
Comment 2 Nick Clemens 2014-09-11 01:10:37 UTC
CONFLICT (content): Merge conflict in C4/Items.pm
Failed to merge in the changes.
Patch failed at 0001 Bug 12874: A DB field without a default mapping is set to a default value on editing
Comment 3 Jonathan Druart 2014-09-11 07:58:05 UTC Comment hidden (obsolete)
Comment 4 Nick Clemens 2014-09-11 10:15:58 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2014-09-12 14:23:14 UTC
Created attachment 31555 [details] [review]
[PASSED QA] Bug 12874: A DB field without a default mapping is set to a default value on editing

If an item is edited and a field is not mapped to Koha, it is to 0 or
NULL (depending on the default value defined).

This patch adds a check on the mapping before editing the item. It there
is no mapping, the DB value is not erased.

Test plan:
1/ Edit an item and fill a value for a field
2/ Unmap this field
3/ Edit the item
4/ Verify that the value is not erased (using the MySQL CLI)

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Tomás Cohen Arazi 2014-10-11 15:57:40 UTC
Patch pushed to master.

Thanks Jonathan!