Bug 7374 - Add remote image option for authorized values
Summary: Add remote image option for authorized values
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement with 1 vote (vote)
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
: 29624 (view as bug list)
Depends on: 29867
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-21 21:40 UTC by Nicole C. Engard
Modified: 2024-03-07 16:13 UTC (History)
15 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This patch updates authorized values management to add the option of specifying a remote image to be associated with an authorized value. This functionality matches what was already available for item types: The ability to specify a full URL to an image file. Modifying a collection code with a remote image will make the image visible on catalog advanced search pages in the OPAC and staff interface when the option to select a collection is enabled.
Version(s) released in:
22.05.00


Attachments
Bug 7374: Can't upload icon for auth values (3.70 KB, patch)
2017-07-07 14:37 UTC, David Roberts
Details | Diff | Splinter Review
Bug 7374: Can't upload icon for auth values (4.79 KB, patch)
2017-07-07 14:37 UTC, David Roberts
Details | Diff | Splinter Review
Bug 7374: Can't upload icon for auth values (4.98 KB, patch)
2017-07-14 05:58 UTC, Dilan Johnpullé
Details | Diff | Splinter Review
Bug 7374: Add remote image option for authorized values (11.21 KB, patch)
2022-01-13 14:14 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7374: Add remote image option for authorized values (11.27 KB, patch)
2022-01-19 23:35 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 7374: Add remote image option for authorized values (11.38 KB, patch)
2022-02-02 09:38 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 Nicole C. Engard 2011-12-21 21:40:03 UTC
You can choose an icon for an authorized value, but you can't upload your own image like you can for the item type icons.
Comment 1 Katrin Fischer 2012-04-11 05:59:21 UTC
I confirm the "remote image" tab is still missing for authorized values from current master.
Comment 2 Katrin Fischer 2014-07-12 11:31:01 UTC
Still valid.
Comment 3 Paul Poulain 2016-06-04 09:03:27 UTC
still valid, removing assignment to me.
Comment 4 David Roberts 2017-07-07 14:37:17 UTC Comment hidden (obsolete)
Comment 5 David Roberts 2017-07-07 14:37:23 UTC Comment hidden (obsolete)
Comment 6 David Roberts 2017-07-07 14:41:50 UTC
Test plan:

Apply patch and ensure that the noItemTypeImages syspref is set to yes.

Add a local image to an authorised value, for example a LOC policy. 

Check that the local image displays in the list of values.

Check that the image displays in the advanced search screen of the OPAC (if using an auth value that displays in the OPAC, i.e. LOC or CCODE)

Check that the remote image can be removed.

Check that a delivered image can still be selected and removed.
Comment 7 Dilan Johnpullé 2017-07-14 05:58:08 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2017-07-17 16:39:10 UTC
Patch does not apply:
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt).                              
error: could not build fake ancestor     

You should also correct the email address and the name of the author of the patch.
Comment 9 David Roberts 2017-07-18 22:20:59 UTC
I'm not sure why my patches have been obsoleted and replaced with a different one?
Comment 10 Katrin Fischer 2017-07-19 05:47:48 UTC
Hi David, when a sign off is added, the patch is replaced, but it should contain the same changes plus the sign off line. Do you mean the code changed are different from yours? It looks same on first glance.
Comment 11 Lucas Gass 2020-05-21 20:49:45 UTC
still valid as the remote image tab is still missing in master
Comment 12 David Roberts 2020-05-21 20:50:54 UTC
(In reply to Lucas Gass from comment #11)
> still valid as the remote image tab is still missing in master

Yes, this is still a work in progress - it's about half complete at the moment. Hopefully I'll get round to finishing it shortly.
Comment 13 Katrin Fischer 2021-12-06 00:05:50 UTC
*** Bug 29624 has been marked as a duplicate of this bug. ***
Comment 14 Owen Leonard 2022-01-13 14:14:53 UTC
Created attachment 129401 [details] [review]
Bug 7374: Add remote image option for authorized values

This patch adds the option of using a remote image for an authorized
value, just as you can with item types.

To test, apply the patch and go to Administration -> Authorized values.

- Click "CCODE" to view the collection authorized values.
- Edit a collection code.
- In the form, under "Choose an icon," there should now be a "Remote
  image" tab.
- Enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png
- Click "Save."
- After the page redirects to the list of collection codes you should
  see your image in the table next to the code you edited.
- Test that you can still edit a collection to set "No image" or to
  use one of the local image sets.
- Test that remote images can also be added when adding a new
  collection.

- Make sure "ccode" is in the "AdvancedSearchTypes" sytem preference.
- Go to the catalog's advanced search page and click the "Collection"
  tab.
- You should see your collection image in the list of collections.
- Perform the same check in the OPAC.
Comment 15 Christopher Brannon 2022-01-13 23:18:26 UTC
I'm testing on a sandbox, and before I add the patch, everything work right.  But when I add the patch, if I try to edit an existing CCODE, it acts like it is creating a new value instead of editing the existing one.  All fields are blank.  This patch is messing with existing functionality.
Comment 16 Owen Leonard 2022-01-14 11:37:07 UTC
I've tested this again in my local test system and I can't reproduce that problem. I wonder if it could be an issue with the sandbox? I'm going to put this back to "Needs signoff" in the hopes that someone can try again.
Comment 17 Noémie Labine 2022-01-19 15:46:39 UTC
I am currently learning how to test patches on sandboxes so maybe someone else can countercheck, but the patch seems to work fine for me ! I can edit existing values and I don't see any other problems. 

I'm not gonna change the status for now.
Comment 18 Lucas Gass 2022-01-19 23:35:41 UTC
Created attachment 129633 [details] [review]
Bug 7374: Add remote image option for authorized values

This patch adds the option of using a remote image for an authorized
value, just as you can with item types.

To test, apply the patch and go to Administration -> Authorized values.

- Click "CCODE" to view the collection authorized values.
- Edit a collection code.
- In the form, under "Choose an icon," there should now be a "Remote
  image" tab.
- Enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png
- Click "Save."
- After the page redirects to the list of collection codes you should
  see your image in the table next to the code you edited.
- Test that you can still edit a collection to set "No image" or to
  use one of the local image sets.
- Test that remote images can also be added when adding a new
  collection.

- Make sure "ccode" is in the "AdvancedSearchTypes" sytem preference.
- Go to the catalog's advanced search page and click the "Collection"
  tab.
- You should see your collection image in the list of collections.
- Perform the same check in the OPAC.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 19 Lucas Gass 2022-01-19 23:37:23 UTC
(In reply to Noémie Labine from comment #17)
> I am currently learning how to test patches on sandboxes so maybe someone
> else can countercheck, but the patch seems to work fine for me ! I can edit
> existing values and I don't see any other problems. 
> 
> I'm not gonna change the status for now.

Noémie, it worked well for me too!
Comment 20 Jonathan Druart 2022-02-02 09:38:09 UTC
Created attachment 130064 [details] [review]
Bug 7374: Add remote image option for authorized values

This patch adds the option of using a remote image for an authorized
value, just as you can with item types.

To test, apply the patch and go to Administration -> Authorized values.

- Click "CCODE" to view the collection authorized values.
- Edit a collection code.
- In the form, under "Choose an icon," there should now be a "Remote
  image" tab.
- Enter a remote image url, e.g. https://via.placeholder.com/50/FF0000/FFFFFF.png
- Click "Save."
- After the page redirects to the list of collection codes you should
  see your image in the table next to the code you edited.
- Test that you can still edit a collection to set "No image" or to
  use one of the local image sets.
- Test that remote images can also be added when adding a new
  collection.

- Make sure "ccode" is in the "AdvancedSearchTypes" sytem preference.
- Go to the catalog's advanced search page and click the "Collection"
  tab.
- You should see your collection image in the list of collections.
- Perform the same check in the OPAC.

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

JD amended patch: fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 21 Jonathan Druart 2022-02-02 09:40:29 UTC
All good for me as well. Christopher, it would be great if you could test again once this gets pushed, in case we all missed something!
Comment 22 Fridolin Somers 2022-02-11 00:00:24 UTC
This long time wanted enhancement needs a good release note ;)
Comment 23 Fridolin Somers 2022-02-11 00:37:29 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄