Bug 34963

Summary: Unable to delete fields in suggestions
Product: Koha Reporter: David Roberts <david.roberts>
Component: AcquisitionsAssignee: Jonathan Druart <jonathan.druart>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, fridolin.somers, jbalway, jonathan.druart, lucas, michaela.sieber, r.delahunty
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35176
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12
Circulation function:
Bug Depends on: 23991    
Bug Blocks:    
Attachments: Bug 34963: Restore the ability to blank fields when editing a suggestion
Bug 34963: Restore the ability to blank fields when editing a suggestion
Bug 34963: Restore the ability to blank fields when editing a suggestion

Description David Roberts 2023-09-29 16:20:25 UTC
It doesn't appear possible to delete a note in a suggestion, although it is possible to edit it. To reproduce, create a suggestion record and add a note and non-public note. Edit the suggestion and change the contents of your notes, and save. The notes will both correctly update to your new note text. Now edit the suggestion again and this time completely delete the note. The data does not get deleted.
Comment 1 Joseph Alway 2023-10-10 18:28:09 UTC
I noticed this is happening as well.

It happens for the Note and Non-Public Note field in a suggestion.

Our current version: 22.11.09.000 Rosalie
Comment 2 Katrin Fischer 2023-10-16 21:07:36 UTC
I can replicate this on current master.
Comment 3 Katrin Fischer 2023-10-16 21:10:04 UTC
Actually it's all the non-mandatory fields - you can't empty them, only edit.
Comment 4 Caroline Cyr La Rose 2023-11-06 21:11:23 UTC
I just noticed this is also true for the new non-public note...
Comment 5 Katrin Fischer 2023-11-06 21:17:25 UTC
It's all the text fields :( But I haven't been able to get developer's attention on this bug.
Comment 6 Jonathan Druart 2024-04-17 09:51:16 UTC
Created attachment 164986 [details] [review]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen
Comment 7 Jonathan Druart 2024-04-17 09:51:36 UTC
Sorry, I was not aware of this bug (or I forgot!)
Comment 8 PTFS Europe Sandboxes 2024-04-17 14:42:24 UTC
Created attachment 165020 [details] [review]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen

Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Comment 9 Ray Delahunty 2024-04-17 14:47:25 UTC
Added 2 suggestions, one via Intranet, one via OPAC. Added content to publisher, public and private notes fields. Prior to patch application could not delete any of the three. After the patch applied could delete all three fields in both OPAC and Intranet sourced suggestions. (I did restart services- not sure if that was necessary- am new to signoffs).
Comment 10 Katrin Fischer 2024-04-18 20:48:35 UTC
It never hurts to restart the services :) 

Thanks for the fix and sign-off!
Comment 11 Nick Clemens (kidclamp) 2024-04-19 13:42:25 UTC
Created attachment 165200 [details] [review]
Bug 34963: Restore the ability to blank fields when editing a suggestion

Regression introduced by bug 23991.
We don't want to remove the fields from the edition if they are empty.

Ideally we should have separate parameters for edition and search, but
this is the low-effort fix, and hopefully won't introduce side-effects.

Test plan:
Try to edit a suggestion and blank some fields
Try to search for suggestions using the search form on the left of the
screen

Signed-off-by: Ray Delahunty <lib-systems@arts.ac.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Katrin Fischer 2024-04-19 16:07:23 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 13 Fridolin Somers 2024-05-23 13:52:14 UTC
Pushed to 23.11.x for 23.11.06

Patch adapted : 'cud-save' => 'save'
Comment 14 Lucas Gass (lukeg) 2024-05-28 19:45:58 UTC
Backported to 23.05.x for upcoming 23.05.12