|
|
@ -253,10 +253,14 @@ function islandora_datastream_version_replace_form($form, &$form_state, Abstract |
|
|
|
$form_state['dsid'] = $datastream->id; |
|
|
|
$form_state['dsid'] = $datastream->id; |
|
|
|
$form_state['object'] = $object; |
|
|
|
$form_state['object'] = $object; |
|
|
|
$extensions = islandora_get_datastreams_requirements_from_models($object->models); |
|
|
|
$extensions = islandora_get_datastreams_requirements_from_models($object->models); |
|
|
|
$ext = array(NULL); |
|
|
|
$mime_detect = new MimeDetect(); |
|
|
|
if(isset($extensions[$datastream->id]['mime'])) { |
|
|
|
$ext = array(); |
|
|
|
$ext = array(implode(",", $extensions[$datastream->id]['mime'])); |
|
|
|
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')); |
|
|
|
$upload_size = min((int) ini_get('post_max_size'), (int) ini_get('upload_max_filesize')); |
|
|
|
return array( |
|
|
|
return array( |
|
|
|
'dsid_fieldset' => array( |
|
|
|
'dsid_fieldset' => array( |
|
|
@ -318,7 +322,7 @@ function islandora_datastream_version_replace_form_submit($form, &$form_state) { |
|
|
|
catch (exception $e) { |
|
|
|
catch (exception $e) { |
|
|
|
drupal_set_message(t('An error occurred during datastream updates. See watchlog for more information.'), 'error'); |
|
|
|
drupal_set_message(t('An error occurred during datastream updates. See watchlog for more information.'), 'error'); |
|
|
|
watchdog('islandora', |
|
|
|
watchdog('islandora', |
|
|
|
'Failed to add new versionable datastream.</br>code: @code<br/>message: @msg', |
|
|
|
'Failed to add new versionable datastream.<br/>code: @code<br/>message: @msg', |
|
|
|
array( |
|
|
|
array( |
|
|
|
'@code' => $e->getCode(), |
|
|
|
'@code' => $e->getCode(), |
|
|
|
'@msg' => $e->getMessage(), |
|
|
|
'@msg' => $e->getMessage(), |
|
|
|