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".
Created attachment 40987 [details] [review] 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.
Created attachment 41076 [details] [review] Bug 14141: Do not let edit the branch when updating/copying notice Works ok.
Created attachment 41077 [details] [review] Bug 14141: Do not let edit the branch when updating/copying notice Works ok.
Ugh - this sounds quite annoying when you accidentally set the wrong library. But the duplicateing is also bad :(
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.
Created attachment 42769 [details] [review] Bug 14141: Fix copy action Test plan: Try to copy a letter to a library which already have this letter (same letter_code) defined.
Created attachment 42966 [details] [review] 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>
Created attachment 42967 [details] [review] 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>
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>
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>
Patches pushed to master. Thanks Jonathan!
Pushed to 3.20.x will be in 3.20.5
Pushed to 3.18.x, is in 3.18.12.