Bug 35344 - Patron image upload does not warn about missing cardnumber
Summary: Patron image upload does not warn about missing cardnumber
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-16 04:56 UTC by David Cook
Modified: 2023-12-14 21:20 UTC (History)
4 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:
24.05.00,23.11.01,23.05.07
Circulation function:


Attachments
Bug 35344: Warn on patron image upload if missing cardnumber (4.12 KB, patch)
2023-11-16 05:13 UTC, David Cook
Details | Diff | Splinter Review
Bug 35344: Warn on patron image upload if missing cardnumber (4.17 KB, patch)
2023-11-24 22:13 UTC, David Nind
Details | Diff | Splinter Review
Bug 35344: Warn on patron image upload if missing cardnumber (4.27 KB, patch)
2023-12-01 10:49 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2023-11-16 04:56:03 UTC
As noted in bug 34018, the ./tools/picture-upload.pl silently fails if a patron doesn't have a cardnumber.

It would be better to use the borrowernumber, but that would require rewriting the whole script, which seems like a lot of work for little gain.

Instead, we'll add a warning / prevent upload if the patron doesn't have a cardnumber. That way the staff user can at least know they should add a cardnumber if they want to upload a patron image.
Comment 1 David Cook 2023-11-16 05:13:33 UTC
Created attachment 159019 [details] [review]
Bug 35344: Warn on patron image upload if missing cardnumber

This change displays a warning message instead of the patron image
upload feature in the patron record when the patron is missing the
cardnumber.

Without this change, the staff user can try to upload a patron image
but it will silently fail. This change warns the staff user of the
cardnumber requirement for patron image upload.

Test plan:
0. Apply the patch
1. Enable the "patronimages" system preference
2. Go to http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
3. Click "Add" over the patron image placeholder
4. Note the "Upload photo" button and the ability to take a patron photo if your
device has a camera
5. Remove "cardnumber" from BorrowerMandatoryField
6. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
7. Edit the patron to remove the cardnumber
8. Click "Add" over the patron image placeholder
9. Note that no patron image upload features appear. Instead, only
a warning appears stating that the patron needs a cardnumber before
the patron image upload can be performed
Comment 2 David Nind 2023-11-24 22:13:16 UTC
Created attachment 159247 [details] [review]
Bug 35344: Warn on patron image upload if missing cardnumber

This change displays a warning message instead of the patron image
upload feature in the patron record when the patron is missing the
cardnumber.

Without this change, the staff user can try to upload a patron image
but it will silently fail. This change warns the staff user of the
cardnumber requirement for patron image upload.

Test plan:
0. Apply the patch
1. Enable the "patronimages" system preference
2. Go to http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
3. Click "Add" over the patron image placeholder
4. Note the "Upload photo" button and the ability to take a patron photo if your
device has a camera
5. Remove "cardnumber" from BorrowerMandatoryField
6. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
7. Edit the patron to remove the cardnumber
8. Click "Add" over the patron image placeholder
9. Note that no patron image upload features appear. Instead, only
a warning appears stating that the patron needs a cardnumber before
the patron image upload can be performed

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2023-12-01 10:49:16 UTC
Created attachment 159439 [details] [review]
Bug 35344: Warn on patron image upload if missing cardnumber

This change displays a warning message instead of the patron image
upload feature in the patron record when the patron is missing the
cardnumber.

Without this change, the staff user can try to upload a patron image
but it will silently fail. This change warns the staff user of the
cardnumber requirement for patron image upload.

Test plan:
0. Apply the patch
1. Enable the "patronimages" system preference
2. Go to http://localhost:8081/cgi-bin/koha/members/moremember.pl?borrowernumber=51
3. Click "Add" over the patron image placeholder
4. Note the "Upload photo" button and the ability to take a patron photo if your
device has a camera
5. Remove "cardnumber" from BorrowerMandatoryField
6. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
7. Edit the patron to remove the cardnumber
8. Click "Add" over the patron image placeholder
9. Note that no patron image upload features appear. Instead, only
a warning appears stating that the patron needs a cardnumber before
the patron image upload can be performed

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Katrin Fischer 2023-12-11 18:46:56 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 5 Fridolin Somers 2023-12-12 07:40:34 UTC
Pushed to 23.11.x for 23.11.01
Comment 6 Lucas Gass (lukeg) 2023-12-14 21:20:24 UTC
Backported to 23.05.x for upcoming 23.05.07