Bug 17673 - HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff
Summary: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 17501
Blocks:
  Show dependency treegraph
 
Reported: 2016-11-23 16:33 UTC by Marcel de Rooy
Modified: 2017-01-03 15:29 UTC (History)
2 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:
Circulation function:


Attachments
Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff (1.28 KB, patch)
2016-11-24 07:51 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17673: HTML5Media: Using an OPAC URL for an uploaded file does not always work in staff (1.31 KB, patch)
2016-11-24 07:55 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.