Skip to content

Commit

Permalink
Add Alma Option in Drupal
Browse files Browse the repository at this point in the history
  • Loading branch information
inkuss committed Aug 14, 2023
1 parent 8928ea2 commit 93347f4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
13 changes: 11 additions & 2 deletions edoweb/edoweb.module
Original file line number Diff line number Diff line change
Expand Up @@ -702,9 +702,12 @@ function _edoweb_http_request($request_url, $http_options) {
'timeout' => 60,
);

// drupal_set_message("Request-URL: $request_url", 'debug');
$http_response = drupal_http_request($request_url, $http_options);

$request = explode(' ', $http_response->request);
// drupal_set_message("Response->Request: $request", 'debug');
// drupal_set_message("Response Code: $http_response->code", 'debug');
$is_search_request = $is_api_request && (substr(ltrim(next($request), '/'), 0, 6) == 'search');
if ($modifying && !$is_search_request) {
console_log($http_response);
Expand Down Expand Up @@ -745,8 +748,14 @@ function _edoweb_http_request($request_url, $http_options) {
$code = $http_response->code;
} else {
$data = json_decode($http_response->data);
$message = $data->text;
$code = $data->code;
if( $data ) {
$message = $data->text;
$code = $data->code;
}
else {
$message = "Allgemeiner Server-Fehler";
$code = 500;
}
}
drupal_set_message("$code: $message", $status_type);
}
Expand Down
3 changes: 2 additions & 1 deletion edoweb/php/adminForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ function edoweb_basic_admin($form, &$form_state, $entity) {
'#attributes' => array('disabled' => 'disabled'),
'#options' => array(
'epicur' => t('Register Urn'),
'aleph' => t('Copy to Catalog'),
'aleph' => t('Copy to Aleph-Katalog'),
'alma' => t('Copy to Alma-Katalog'),
'oaidc' => t('Support OAI-PMH'),
'mets' => t('OAI-PMH METS'),
'rdf' => t('OAI-PMH RDF'),
Expand Down

0 comments on commit 93347f4

Please sign in to comment.