Bug 12874 - On editing an item, some fields can be set to NULL
Summary: On editing an item, some fields can be set to NULL
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Galen Charlton
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 13074 13465 16428
  Show dependency treegraph
 
Reported: 2014-09-04 14:47 UTC by Jonathan Druart
Modified: 2016-12-05 21:22 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12874: A DB field without a default mapping is set to a default value on editing (6.84 KB, patch)
2014-09-04 14:47 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 12874: A DB field without a default mapping is set to a default value on editing (7.37 KB, patch)
2014-09-11 07:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 12874: A DB field without a default mapping is set to a default value on editing (7.44 KB, patch)
2014-09-11 10:15 UTC, Nick Clemens
Details | Diff | Splinter Review
[PASSED QA] Bug 12874: A DB field without a default mapping is set to a default value on editing (7.49 KB, patch)
2014-09-12 14:23 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!