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.
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
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>
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>
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.01
Backported to 23.05.x for upcoming 23.05.07