Bug 6381 - Add script to populate 856$q field based on contents of 856$u
Summary: Add script to populate 856$q field based on contents of 856$u
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Command-line Utilities (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Galen Charlton
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 16:18 UTC by Doug Dearden
Modified: 2019-03-16 10:39 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Doug Dearden 2011-05-20 16:18:06 UTC
One of the new features implemented in the 3.4 release is the ability to use the 856$u field to store a URI that points to an image file, and display the image rather than standard or optional link text (see bug 5738).  This feature is turned on by a system preference, but is also controlled at the record level by the contents of the corresponding 856$q field.  If the 856$q field is empty or does not have a valid MIME type entered in it the corresponding 856$u field will not be displayed as an image regardless of the system preference setting.
  
A script is needed that will read the contents of each of the 856$u fields looking for one of the valid MIME type extensions at the end of the file name (bmp, cod, gif, ief, jpe, jpeg, jpg, jfif, png, svg, tif, tiff, ras, cmx, ico, pnm, pbm, pgm, ppm, rgb, xbm, xpm, xwd), check to see if there is a corresponding 856$q field, and populate it accordingly or create a new 856$q field if one doesn’t exist.   Options passed to the script should allow for the 856$q field to be left unchanged if it is not empty, or to be overwritten regardless of content if a valid MIME extension is found in the corresponding 856$u field. 

I have been working on this script but find myself out of my depth, and have other commitments I must turn my attention to.  If any of you experienced Koha perl coders is willing to do this I will be happy to do the testing and sign off work.

Thanks - Doug
Comment 1 Katrin Fischer 2019-03-16 10:39:56 UTC
Wondering if this would be useful as a catalouging plugin/value builder too.