diff --git a/includes/datastream.version.inc b/includes/datastream.version.inc index b9865f73..6b37335d 100644 --- a/includes/datastream.version.inc +++ b/includes/datastream.version.inc @@ -253,10 +253,14 @@ function islandora_datastream_version_replace_form($form, &$form_state, Abstract $form_state['dsid'] = $datastream->id; $form_state['object'] = $object; $extensions = islandora_get_datastreams_requirements_from_models($object->models); - $ext = array(NULL); - if(isset($extensions[$datastream->id]['mime'])) { - $ext = array(implode(",", $extensions[$datastream->id]['mime'])); + $mime_detect = new MimeDetect(); + $ext = array(); + foreach ($extensions[$datastream->id]['mime'] as $key => $value) { + $str = $mime_detect->getExtension($value); + array_push($ext, $str); } + $comma = sizeof($ext) > 1 ? "," : ""; + $ext = array(implode($comma, $ext)); $upload_size = min((int) ini_get('post_max_size'), (int) ini_get('upload_max_filesize')); return array( 'dsid_fieldset' => array( @@ -318,7 +322,7 @@ function islandora_datastream_version_replace_form_submit($form, &$form_state) { catch (exception $e) { drupal_set_message(t('An error occurred during datastream updates. See watchlog for more information.'), 'error'); watchdog('islandora', - 'Failed to add new versionable datastream.
code: @code
message: @msg', + 'Failed to add new versionable datastream.
code: @code
message: @msg', array( '@code' => $e->getCode(), '@msg' => $e->getMessage(), diff --git a/islandora.module b/islandora.module index 2d92f38d..a149c5a7 100644 --- a/islandora.module +++ b/islandora.module @@ -609,8 +609,8 @@ function islandora_permission() { 'description' => t('Regenerate derivatives for an object or per datastream.'), ), ISLANDORA_REPLACE_DATASTREAM_CONTENT => array( - 'title' => t('Replace derivatives'), - 'description' => t('Replace derivatives for an object or per datastream.'), + 'title' => t('Replace datastreams'), + 'description' => t('Replace datastreams for an object or per datastream.'), ), ); } @@ -1893,7 +1893,8 @@ function islandora_islandora_datastream_access($op, AbstractDatastream $datastre $hooks = islandora_invoke_hook_list(ISLANDORA_DERVIATIVE_CREATION_HOOK, $object->models, array($object)); $hooks = islandora_filter_derivatives($hooks, array('force' => TRUE), $object); foreach ($hooks as $hook) { - if ($hook['destination_dsid'] == $datastream->id && islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user)) { + if ($hook['destination_dsid'] == $datastream->id && + (is_null($hook['source_dsid']) || islandora_datastream_access(ISLANDORA_VIEW_OBJECTS, $object[$hook['source_dsid']], $user))) { $applicable_hook = TRUE; break; } diff --git a/theme/theme.inc b/theme/theme.inc index 30bcf9ff..c81a918d 100644 --- a/theme/theme.inc +++ b/theme/theme.inc @@ -23,10 +23,9 @@ function islandora_preprocess_islandora_default_edit(array &$variables) { $header[] = array('data' => t('Size')); if (user_access(ISLANDORA_VIEW_DATASTREAM_HISTORY)) { $header[] = array('data' => t('Versions')); - $header[] = array('data' => t('Replace')); } - $header[] = array('data' => t('Operations'), 'colspan' => '4'); + $header[] = array('data' => t('Operations'), 'colspan' => '5'); $table_attributes = array('class' => array('manage-datastreams')); $rows = array();