Bug 14141 - Changing the Library for a notice duplicates the notice instead of updating it
Summary: Changing the Library for a notice duplicates the notice instead of updating it
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-04 14:52 UTC by Kyle M Hall (khall)
Modified: 2016-06-21 21:38 UTC (History)
7 users (show)

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


Attachments
Bug 14141: Do not let edit the branch when updating/copying notice (3.61 KB, patch)
2015-07-14 11:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14141: Do not let edit the branch when updating/copying notice (3.69 KB, patch)
2015-07-18 05:52 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14141: Do not let edit the branch when updating/copying notice (3.69 KB, patch)
2015-07-18 05:53 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 14141: Fix copy action (1.03 KB, patch)
2015-09-22 10:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14141: Do not let edit the branch when updating/copying notice (3.73 KB, patch)
2015-09-30 02:02 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 14141: Fix copy action (1.09 KB, patch)
2015-09-30 02:03 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
[PASSED QA] Bug 14141: Do not let edit the branch when updating/copying notice (3.80 KB, patch)
2015-09-30 21:59 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 14141: Fix copy action (1.15 KB, patch)
2015-09-30 21:59 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2015-05-04 14:52:36 UTC
If you edit a notice for a library and choose to change the Library field, the notice is created for that library, but the old notice remains. Essentially this turns the "update" into a "copy with edits".
Comment 1 Jonathan Druart 2015-07-14 11:07:18 UTC Comment hidden (obsolete)
Comment 2 Amit Gupta 2015-07-18 05:52:37 UTC Comment hidden (obsolete)
Comment 3 Amit Gupta 2015-07-18 05:53:07 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2015-07-19 21:49:48 UTC
Ugh - this sounds quite annoying when you accidentally set the wrong library. But the duplicateing is also bad :(
Comment 5 Katrin Fischer 2015-09-13 13:17:42 UTC
This doesn't work for me:

1) Copy an 'all libraries' notice to another branch
2) Try to save it:
   A letter with the code 'DUE' already exists for 'undefined'.

Can you check? I had to resolve a conflict, maybe I got that wrong.
Comment 6 Jonathan Druart 2015-09-22 10:57:01 UTC Comment hidden (obsolete)
Comment 7 Nick Clemens (kidclamp) 2015-09-30 02:02:50 UTC Comment hidden (obsolete)
Comment 8 Nick Clemens (kidclamp) 2015-09-30 02:03:48 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2015-09-30 21:59:15 UTC
Created attachment 42983 [details] [review]
[PASSED QA] Bug 14141: Do not let edit the branch when updating/copying notice

If a user modify the library when he's updating a notice, the notice
will be duplicated, instead of modified.

To reproduce:
1/ Go on the notice & slips tools (tools/letter.pl)
2/ Create a notice A for library L1
3/ Edit this notice and update the library with L2
4/ On the list view, you will observe that 2 notices A now exist, one
for L1 and one for L2.

The code in tools/letters.pl should be rebuilt completely, it becomes a
house of cards. To prevent this bug, I suggest to not let the user
modify the library value on editing a notice.
It cans be done by copying the notice to another library and remove the
original one.
Counter patch welcomed.

Test plan:
1/ Go on the notice & slips tools (tools/letter.pl).
2/ Create a notice A for library L1.
3/ Edit this notice: you are not able to modify the library anymore.
4/ Copy the notice to library L2. You are not able to modify the library
neither.

Works ok.

Signed-off-by: Amit Gupta <amit.gupta@informaticsglobal.com>
Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2015-09-30 21:59:29 UTC
Created attachment 42984 [details] [review]
[PASSED QA] Bug 14141: Fix copy action

Test plan:
Try to copy a letter to a library which already have this letter (same
letter_code) defined.

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Tomás Cohen Arazi (tcohen) 2015-10-02 17:41:17 UTC
Patches pushed to master.

Thanks Jonathan!
Comment 12 Chris Cormack 2015-10-23 08:48:40 UTC
Pushed to 3.20.x will be in 3.20.5
Comment 13 Liz Rea 2015-11-02 21:04:22 UTC
Pushed to 3.18.x, is in 3.18.12.