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

deleting file that does not exist while making derivatives

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 7.x-1.3, 7.x-1.4, 7.x-1.5
    • Fix Version/s: 7.x-1.6
    • Component/s: Scholar Module
    • Labels:
      None

      Description

      when the derivatives TN and PREVIEW are created, for each derivative the recent log shows the following error:
      The file temporary://something-3594.PDF.pdf was not deleted, because it does not exist.

      the error can be fixed in two ways:
      1.)
      diff -r my.site/modules/islandora_scholar-7.x-1.5/includes/derivatives.inc all/modules/islandora_scholar-7.x-1.5/includes/derivatives.inc
      202c202
      < //file_unmanaged_delete($file_uri); //funkcije iz kojih se poziva ova funkcija rade upravo ovo

      > file_unmanaged_delete($file_uri);

      2.)
      function islandora_scholar_add_tn_derivative(AbstractObject $object, $force = FALSE, $hook = array()) {
      if ($force || !isset($object['TN']))

      { $width = variable_get('islandora_scholar_thumbnail_width', 200); $height = variable_get('islandora_scholar_thumbnail_height', 200); $file_uri = islandora_scholar_get_derivative_source_as_unmanaged_file($object, $hook['source_dsid']); $results = islandora_scholar_add_jpg_derivative($object, $file_uri, 'TN', $width, $height, $force, $hook['source_dsid']); // make a condition here if file is already deleted then dont delete it now file_unmanaged_delete($file_uri); return $results; }

      }

      function islandora_scholar_add_preview_derivative(AbstractObject $object, $force = FALSE, $hook = array()) {
      if ($force || !isset($object['PREVIEW']))

      { $width = variable_get('islandora_scholar_preview_width', 500); $height = variable_get('islandora_scholar_preview_height', 700); $file_uri = islandora_scholar_get_derivative_source_as_unmanaged_file($object, $hook['source_dsid']); $results = islandora_scholar_add_jpg_derivative($object, $file_uri, 'PREVIEW', $width, $height, $force, $hook['source_dsid']); // make a condition here if file is already deleted then dont delete it now file_unmanaged_delete($file_uri); return $results; }

      }

        Attachments

          Activity

            People

            • Assignee:
              dpinokrayon Diego Pino Navarro
              Reporter:
              domagoj.ulamec Domagoj Ulamec
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: