Bug 9422 - Patron picture uploader ignores patronimages syspref
Summary: Patron picture uploader ignores patronimages syspref
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial (vote)
Assignee: Katrin Fischer
QA Contact:
URL:
Keywords:
Depends on: 8387
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-18 02:36 UTC by Jared Camins-Esakov
Modified: 2020-11-30 21:46 UTC (History)
6 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:
20.05.00,19.11.06, 19.05.11


Attachments
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off (4.30 KB, patch)
2019-02-10 11:19 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off (4.36 KB, patch)
2019-02-12 14:10 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off (4.44 KB, patch)
2020-03-28 11:57 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Camins-Esakov 2013-01-18 02:36:45 UTC
Although the patronimages syspref says it sets whether or not patron images can be uploaded, in fact all it does is toggle display. The uploader should probably not be available when the feature is disabled, to prevent librarians from getting frustrated when it seems not to work.
Comment 1 Katrin Fischer 2019-02-10 11:19:57 UTC
Created attachment 84946 [details] [review]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off

In addition to checking the patron image upload permission, this
adds a check for the patronimages system preference to the tools
home page and sidebar.

To test:
- Check that the patron image upload tool only displays when
  - system preference patronimages is set to 'Allow'
    and user is either
  - superlibrarian or
  - has bath_upload_patron_images permission
- Save URL of patron image uploader page
- Turn off patronimages
- Verify you get redirected to the home page of Koha when trying
  to access the page

Note: this redirect is already used by the stock rotation feature.
Comment 2 Martin Renvoize 2019-02-12 14:10:19 UTC
Created attachment 85021 [details] [review]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off

In addition to checking the patron image upload permission, this
adds a check for the patronimages system preference to the tools
home page and sidebar.

To test:
- Check that the patron image upload tool only displays when
  - system preference patronimages is set to 'Allow'
    and user is either
  - superlibrarian or
  - has bath_upload_patron_images permission
- Save URL of patron image uploader page
- Turn off patronimages
- Verify you get redirected to the home page of Koha when trying
  to access the page

Note: this redirect is already used by the stock rotation feature.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2019-02-12 14:11:17 UTC
Seems sound, works for me. Signing off
Comment 4 Josef Moravec 2019-02-12 20:51:08 UTC
Wouldn't be better to display warning on top of patron image upload page?
Comment 5 Katrin Fischer 2019-02-14 06:33:09 UTC
I was looking for an example for that. I will have another look. Maybe just push a variable to the template and wrap it all in if-else?
Comment 6 Katrin Fischer 2019-02-14 06:33:30 UTC
... or just use the TT plugin. I will try it out.
Comment 7 Katrin Fischer 2020-03-28 11:57:09 UTC
Created attachment 102039 [details] [review]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off

In addition to checking the patron image upload permission, this
adds a check for the patronimages system preference to the tools
home page and sidebar.

To test:
- Check that the patron image upload tool only displays when
  - system preference patronimages is set to 'Allow'
    and user is either
  - superlibrarian or
  - has bath_upload_patron_images permission
- Save URL of patron image uploader page
- Turn off patronimages
- Verify you get redirected to the home page of Koha when trying
  to access the page

Note: this redirect is already used by the stock rotation feature.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Katrin Fischer 2020-03-28 11:58:12 UTC
I'd like to throw the rebased patch out there - I didn't find an example for a page with a message in staff. Stock rotation for example behaves the same as this patch.
Comment 9 Martin Renvoize 2020-03-30 06:04:26 UTC
This one has languished long enough, I think it's a reasonable patch and trivial code.. upgrading my earlier signoff to a PQA
Comment 10 Martin Renvoize 2020-04-03 13:23:58 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 11 Joy Nelson 2020-04-28 20:23:41 UTC
Backported to 19.11.x branch for 19.11.06
Comment 12 Lucas Gass 2020-05-11 19:20:33 UTC
backported to 19.05.x for 19.05.11