From 61204b9168d3a4bf1e1451078436f5b12debe9ed Mon Sep 17 00:00:00 2001 From: Adam Vessey Date: Wed, 2 May 2012 16:06:54 -0400 Subject: [PATCH] Fix datastream replacement errors. --- fedora_repository.module | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fedora_repository.module b/fedora_repository.module index 886ab4d6..7235aa36 100644 --- a/fedora_repository.module +++ b/fedora_repository.module @@ -741,7 +741,7 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { $dsLabel = $form_state['values']['dsLabel']; $streamUrl = ($file !== NULL) ? - url($file->filepath, array('absolute' => TRUE)): + $file->filepath: url($form_state['values']['reference'], array('absolute' => TRUE)); // Remove the original file extension from the label and add the new one @@ -751,10 +751,9 @@ function fedora_repository_replace_stream_form_submit($form, &$form_state) { substr($streamUrl, strrpos($streamUrl, '.')); // Add the file extention to the end of the label. } - - $dformat = $form_state['storage']['mime_type']; + module_load_include('inc', 'fedora_repository', 'api/fedora_item'); $item = new Fedora_Item($pid); $item->modify_datastream($streamUrl, $dsid, $dsLabel, $dformat);