Bug 35929 - Don't submit 'empty' changes to personal details in OPAC
Summary: Don't submit 'empty' changes to personal details in OPAC
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens (kidclamp)
QA Contact: Testopia
URL:
Keywords: rel_22_11_candidate, rel_23_05_candidate, rel_23_11_candidate
Depends on:
Blocks: 36816
  Show dependency treegraph
 
Reported: 2024-01-29 10:32 UTC by Katrin Fischer
Modified: 2024-05-29 14:00 UTC (History)
5 users (show)

See Also:
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


Attachments
Bug 35929: Don't record a change for empty fields submitted in patron form (2.85 KB, patch)
2024-05-01 18:27 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 35929: Don't record a change for empty fields submitted in patron form (2.90 KB, patch)
2024-05-01 18:34 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 35929: Don't record a change for empty fields submitted in patron form (2.98 KB, patch)
2024-05-22 08:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 35929: Remove extra parenthesis (1.19 KB, patch)
2024-05-22 08:04 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2024-01-29 10:32:03 UTC
At the moment you can submit the personal details form without changes, which will create an "empty" address change request in the staff interface.
It would be nice if we checked for changes and didn't create these empty requests.
Comment 1 Katrin Fischer 2024-04-15 09:52:15 UTC
We just got another report of this, so giving this another 'bump'.
Comment 2 Jason Robb 2024-04-29 21:27:50 UTC
+1

We've been getting lots of odd blanks on the pending request modifications lately as well.
Comment 3 Nick Clemens (kidclamp) 2024-05-01 18:27:12 UTC
Created attachment 166022 [details] [review]
Bug 35929: Don't record a change for empty fields submitted in patron form

This is reminiscent of bug 36159 - when a field is submitted as empty, and null in the DB
we need to reject this as a change. I tried to copy the logic from that bug, as well as
deleting submitted changes for hidden fields (from html manipulation)

This should be tested extensively. One note: If you submit a valid change request, then submit a second with no change the second will be ignored, but the first will remain. i.e. if you change your name from 'Nick' to 'Nack' - then realize your typo you cannot submit a new request to change it back untl the initial request is cleared

To test:
1 - Play with PatronSelfModificationBorrowerUnwantedField and PatronSelfModificationMandatory field to have some fields set
2 - Add a patron attribute, or several, that are editable in the OPAC
3 - Try submitting a form with no changes, note a modification requets is submitted
4 - Approve the request
5 - Apply patch, restart all
6 - Try submitted a blank request, you are notified there were no changes
7 - Try to force an unwanted field via html modification
8 - No changes reported
9 - Confirm attributes changes are successful
10 - After a successful request, try submitting a blank request
11 - Note no changes are recorded, but the initial request is still active
Comment 4 Lucas Gass 2024-05-01 18:34:41 UTC
Created attachment 166023 [details] [review]
Bug 35929: Don't record a change for empty fields submitted in patron form

This is reminiscent of bug 36159 - when a field is submitted as empty, and null in the DB
we need to reject this as a change. I tried to copy the logic from that bug, as well as
deleting submitted changes for hidden fields (from html manipulation)

This should be tested extensively. One note: If you submit a valid change request, then submit a second with no change the second will be ignored, but the first will remain. i.e. if you change your name from 'Nick' to 'Nack' - then realize your typo you cannot submit a new request to change it back untl the initial request is cleared

To test:
1 - Play with PatronSelfModificationBorrowerUnwantedField and PatronSelfModificationMandatory field to have some fields set
2 - Add a patron attribute, or several, that are editable in the OPAC
3 - Try submitting a form with no changes, note a modification requets is submitted
4 - Approve the request
5 - Apply patch, restart all
6 - Try submitted a blank request, you are notified there were no changes
7 - Try to force an unwanted field via html modification
8 - No changes reported
9 - Confirm attributes changes are successful
10 - After a successful request, try submitting a blank request
11 - Note no changes are recorded, but the initial request is still active

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Jonathan Druart 2024-05-22 08:04:19 UTC
Created attachment 167006 [details] [review]
Bug 35929: Don't record a change for empty fields submitted in patron form

This is reminiscent of bug 36159 - when a field is submitted as empty, and null in the DB
we need to reject this as a change. I tried to copy the logic from that bug, as well as
deleting submitted changes for hidden fields (from html manipulation)

This should be tested extensively. One note: If you submit a valid change request, then submit a second with no change the second will be ignored, but the first will remain. i.e. if you change your name from 'Nick' to 'Nack' - then realize your typo you cannot submit a new request to change it back untl the initial request is cleared

To test:
1 - Play with PatronSelfModificationBorrowerUnwantedField and PatronSelfModificationMandatory field to have some fields set
2 - Add a patron attribute, or several, that are editable in the OPAC
3 - Try submitting a form with no changes, note a modification requets is submitted
4 - Approve the request
5 - Apply patch, restart all
6 - Try submitted a blank request, you are notified there were no changes
7 - Try to force an unwanted field via html modification
8 - No changes reported
9 - Confirm attributes changes are successful
10 - After a successful request, try submitting a blank request
11 - Note no changes are recorded, but the initial request is still active

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2024-05-22 08:04:22 UTC
Created attachment 167007 [details] [review]
Bug 35929: Remove extra parenthesis

and make it more readable

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 7 Katrin Fischer 2024-05-22 13:47:56 UTC
Thanks for that one!
Comment 8 Katrin Fischer 2024-05-22 14:20:00 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-05-29 14:00:36 UTC
Pushed to 23.11.x for 23.11.06