• Marcel de Rooy's avatar
    Bug 17501: Remove Koha::Upload::get from Koha::Upload · 158442eb
    Marcel de Rooy authored
    The get routine actually returns records from uploaded_files. It should be
    possible to replace its calls by direct calls of Koha::UploadedFiles.
    This patch is the crux of this patch set. It deals with all scripts that
    use Koha::Upload.
    In the process we do:
    [1] Add a file_handle method to Koha::UploadedFile. This was previously
        arranged via the fh parameter of get.
    [2] Add a full_path method to UploadedFile. Previously returned in the
        path hash key of get. (Name is replaced by filename.)
    [3] Add a search_term method too (implementing get({ term => .. }).
        This logic came from _lookup.
    [4] Add a keep_file parameter to delete method. Only used in test now.
    Test plan:
    [1] Run t/db_dependent/Upload.t
    [2] Go to Tools/Upload. Add an upload, download and delete.
    [3] Add another public upload , search for it.
        Use the hashvalue to download via opac with URL:
    [4] Go to Tools/Stage MARC for import. Import a marc file.
    [5] Go to Tools/Upload local cover image. Import an image file.
        Enable OPACLocalCoverImages to see result.
    [6] Test uploading a offline circulation file:
        Enable AllowOfflineCirculation, and create a koc file (plain text):
        Line1: Version=1.0\tA=1\tB=2
        Line2: 2016-11-23 16:00:00 345\treturn\t[barcode]
        Note: Replace tabs and barcode. The number of tabs is essential!
        Checkout the item with your barcode.
        Go to Circulation/Offline circulation file upload.
        Upload and click Apply directly.
        Checkout again. Repeat Offline circulation file upload.
        Now click Add to offline circulation queue.
    [7] Connect the upload plugin to field 856$u.
        Enable HTML5MediaEnabled.
        Upload a webm file via the plugin. Click Choose to save the URL,
        and put 'video/webm' into 856$q. Save the biblio record.
        Check if you see the media tab with player on staff detail.
        (See also: Bug 17673 about empty OPACBaseURL.)
    Signed-off-by: 's avatarMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
    Signed-off-by: 's avatarTomas Cohen Arazi <tomascohen@theke.io>
    Signed-off-by: joubu's avatarJonathan Druart <jonathan.druart@bugs.koha-community.org>
    Signed-off-by: 's avatarKyle M Hall <kyle@bywatersolutions.com>
HTML5Media.pm 9.74 KB