Bug 17673

Summary: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Staff interfaceAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED WONTFIX QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt, mirko
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 17501    
Bug Blocks:    
Attachments: Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff
Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff

Description Marcel de Rooy 2016-11-23 16:33:17 UTC
Currently, playing an uploaded file in the Media tab will not work. The URL is invalid.

The URLs should be:

OPAC /cgi-bin/koha/opac-retrieve-file.pl?id=bce868a0f5521e9329ccbc73414b4927
STAFF /cgi-bin/koha/opac/opac-retrieve-file.pl?id=bce868a0f5521e9329ccbc73414b4927

Note that the URL used in staff is the OPAC one from 856$u.
In this case "opac-retrieve-file" should be prefixed with "opac/".

Alternatively, the staff upload URL could be:
/cgi-bin/koha/tools/upload.pl?op=download&id=316
NOTE: In this case the id is the real id; in opac parameter id is actually used for the hashvalue.
Comment 1 Marcel de Rooy 2016-11-23 16:35:18 UTC
Or use OPACBaseURL in all cases?
Comment 2 Marcel de Rooy 2016-11-24 07:51:28 UTC
Created attachment 57732 [details] [review]
Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff

If you did no fill OPACBaseURL, the media URL for an uploaded file will
work in OPAC, but not in staff.
You can solve that by filling OPACBaseURL correctly.
We could also add a simple replace in C4/HTML5Media.pm.

Test plan:
[1] Add an upload (say .webm file) via 856$u in editor.
[2] Check media tab in opac and staff detail.
Comment 3 Marcel de Rooy 2016-11-24 07:52:42 UTC
The patches for 17501 are coming. This patch is built on top of those.
Comment 4 Marcel de Rooy 2016-11-24 07:55:10 UTC
Created attachment 57733 [details] [review]
Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff

If you did not fill OPACBaseURL, the media URL for an uploaded file will
work in OPAC, but not in staff.
You can solve that by filling OPACBaseURL correctly.
We could also add a simple replace in C4/HTML5Media.pm.

Test plan:
[1] Add an upload (say .webm file) via 856$u in editor.
    Put 'video/webm' into 856$q.
[2] Check media tab in opac and staff detail.
Comment 5 Marcel de Rooy 2016-11-24 07:57:27 UTC
Note from the author :)
Still arguable, because the other link on staff detail at Online resources will still not work.