Uploaded image for project: 'Islandora'
  1. Islandora
  2. ISLANDORA-1882

Islandora PDF Download Link: check if datastream exists

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Fix Version/s: 7.x-1.9
    • Component/s: None
    • Labels:
      None

      Description

      The islandora pdf solution pack will create a download link for a pdf, even if the datastream (OBJ) does not exist.

      https://github.com/Islandora/islandora_solution_pack_pdf/blob/7.x/theme/theme.inc#L80

      It should check that the datastream exists, and do a datastream access check on the OBJ DSID before the link is generated.

      --Use Case--
      When viewing a pdf object in islandora, if for some reason the 'OBJ' datastream does not exist, a download link for the non existent datastream is still created and printed on the object page in the template.



      --Technical Approach--
      Add a datastream access check for the OBJ datastream, and check that the OBJ datastream exists before generating a download link.



      --Test Case--
      - Create object with the PDF CModel
      - Add PDF to said object and ingest
      - view object (download link exists)
      - delete the OBJ datastream
      - view object (download link is not shown)


      --Impact--
      This should have very little impact on existing installations, however if the new datastream access check fails on the pdf's OBJ datastream or the OBJ datastream does not exist, the 'islandora_download_link' variable will not be present in the template var's further down the processing chain. This should be a non issue, as the standard practice when working in template_preprocessing function implementations is to check if the variable exists first.



      ----
      Morgan Dawe
      Developer
      discoverygarden inc. | Managing Digital Content

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              morgandawe Morgan Dawe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: