Bug 25444: Backup/restore course items fields correctly
authorKyle M Hall <kyle@bywatersolutions.com>
Tue, 26 May 2020 13:08:15 +0000 (09:08 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 28 May 2020 15:01:55 +0000 (17:01 +0200)
commit84230706499b4673d9061adc2d2ac025fa31a342
treed5c296ef5f6bf5794c921f3e0b0fb98302e99c6b
parent5818d900e8e7927bc437dc60cd992c6a18ceb16f
Bug 25444: Backup/restore course items fields correctly

This patch makes the code set the *_storage fields when adding new
fields to an existing course item. And reverts those fields correctly
when removing the item from the course.

If a new field is enabled on an existing course reserve, the storage
field is not given a value, so when the item goes off reserve, the
item field will always be updated to NULL.

To test:
1. Apply the regression tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/CourseReserves/CourseItems.t
=> FAIL: Tests fail, data is not reverted correctly
3. Apply this patch and repeat 2
=> SUCCESS: Tests pass! Data is correctly reverted
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

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

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