From a29d95297c51037d37d4fefabd2c3ad36fcba75b Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 2 Dec 2010 13:56:48 -0400 Subject: [PATCH 1/2] Suppress warnings from bad HTML in book MODS record retrieval. --- ilives/fedora_ilives.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ilives/fedora_ilives.module b/ilives/fedora_ilives.module index 84a4b4a5..ddab8d77 100644 --- a/ilives/fedora_ilives.module +++ b/ilives/fedora_ilives.module @@ -430,7 +430,7 @@ function retrieve_unapi_MODS_record($url) { $bib_response = drupal_http_request($url); $bib_html = $bib_response->data; $bib_doc = new DOMDocument; - $bib_doc->loadHTML($bib_html); + @$bib_doc->loadHTML($bib_html); $links = $bib_doc->getElementsByTagName('link'); foreach ($links as $link) { if ($link->getAttribute('rel') == 'unapi-server') { From 1cfd45cc028acfec62b4d5db50af5736a890b931 Mon Sep 17 00:00:00 2001 From: Alexander O'Neill Date: Thu, 2 Dec 2010 14:25:37 -0400 Subject: [PATCH 2/2] Cosmetic improvements to book ingest process. --- ilives/book.inc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/ilives/book.inc b/ilives/book.inc index d1ad5055..c7ec2eec 100644 --- a/ilives/book.inc +++ b/ilives/book.inc @@ -36,16 +36,17 @@ class IslandoraBook { '#title' => 'Catalogue item URL', ); $form['unapi_url_submit'] = array( - '#type' => 'submit', - '#value' => t('Retrieve MODS record'), - '#submit' => array('fedora_ilives_retrieve_unapi_submit'), - '#ahah' => array( - 'path' => 'fedora/ilives/retrieve_unapi/js', // path we defined in hook_menu - 'wrapper' => 'mods-wrapper', // the HTML that wraps the element that needs to be replaced - 'method' => 'replace', // the method we're going to use: a replace operation - 'effect' => 'fade', // the effect used when replacing the element (try fade!) - ) - ); + '#type' => 'submit', + '#value' => t('Retrieve MODS record'), + '#submit' => array('fedora_ilives_retrieve_unapi_submit'), + '#ahah' => array( + 'path' => 'fedora/ilives/retrieve_unapi/js', // path we defined in hook_menu + 'wrapper' => 'mods-wrapper', // the HTML that wraps the element that needs to be replaced + 'method' => 'replace', // the method we're going to use: a replace operation + //'effect' => 'fade', // the effect used when replacing the element (try fade!) + ), + '#suffix' => '
', + ); drupal_add_js('', 'inline'); // We define a
wrapper. Everything in it will be replaced. $form['mods'] = array( @@ -56,6 +57,7 @@ class IslandoraBook { $form['mods']['mods_record'] = array( '#type' => 'textarea', '#title' => 'MODS Record to Import', + '#rows' => 20, '#value' => (!empty($mods_save) ? $mods_save['mods']['mods_record'] : ''), ); return $form;