From ba3c48e12e05b0d6eb15a74a8e8e1ff58ceaf7a4 Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Mon, 3 Apr 2017 14:36:53 -0300 Subject: [PATCH] updated for reading conference crossref xml and fixed typo --- includes/doi.inc | 4 ++++ includes/form.inc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/doi.inc b/includes/doi.inc index dbf03da..d7fc8a7 100644 --- a/includes/doi.inc +++ b/includes/doi.inc @@ -37,6 +37,10 @@ function upei_roblib_ill_doi_get_data($form, $doi) { function upei_roblib_ill_populate_form_doi($crossref_xml, $form) { $full_title = $crossref_xml->getElementsbyTagName('full_title') ->item(0)->nodeValue; + if(empty($full_title)) { + $full_title = $crossref_xml->getElementsbyTagName('conference_name') + ->item(0)->nodeValue; + } $form['Title']['#value'] = $full_title; $form['ISSN']['#value'] = $crossref_xml->getElementsbyTagName('issn') ->item(0)->nodeValue; diff --git a/includes/form.inc b/includes/form.inc index 71e70bd..6329681 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -38,7 +38,7 @@ function upei_roblib_ill_form($form, &$form_state) { */ function upei_roblib_ill_form_validate($form, &$form_state) { if ($form_state['step'] == 'upei_roblib_ill_request_form' && empty($form_state['values']['doi']) && empty($form_state['values']['Title']) && - empty($form_state['values']['ArtcleTitle']) + empty($form_state['values']['ArticleTitle']) ) { form_set_error('Title', t('One of "DOI", "Title" or "Article Title" values must be provided')); }