From 9c43f2dce7cdab33c9a590566c55b5f5c6529e64 Mon Sep 17 00:00:00 2001 From: Ben Woodhead Date: Thu, 13 Oct 2011 14:52:10 -0300 Subject: [PATCH] Added a check_plain to getMessage and changed !e to @e --- BatchIngest.inc | 2 +- CollectionClass.inc | 18 +++++++++--------- ConnectionHelper.inc | 4 ++-- ObjectHelper.inc | 4 ++-- api/fedora_item.inc | 4 ++-- api/tagging.inc | 2 +- plugins/DarwinCore.inc | 2 +- plugins/Flv.inc | 4 ++-- plugins/FormBuilder.inc | 8 ++++---- plugins/ModsFormBuilder.inc | 4 ++-- plugins/PersonalCollectionClass.inc | 4 ++-- plugins/Refworks.inc | 4 ++-- plugins/ShowStreamsInFieldSets.inc | 4 ++-- 13 files changed, 32 insertions(+), 32 deletions(-) diff --git a/BatchIngest.inc b/BatchIngest.inc index f4d987e0..efc235a6 100644 --- a/BatchIngest.inc +++ b/BatchIngest.inc @@ -229,7 +229,7 @@ function batch_create_dc_from_mods($mods_xml) { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/CollectionClass.inc b/CollectionClass.inc index 3d2c9f5b..82e4739e 100644 --- a/CollectionClass.inc +++ b/CollectionClass.inc @@ -131,7 +131,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting relationship element from policy stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting relationship element from policy stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $relationship = $xml->relationship[0]; @@ -172,7 +172,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting PID namespace !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting PID namespace @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->contentmodels->contentmodel as $contentModel) { @@ -199,7 +199,7 @@ class CollectionClass { $xml = new SimpleXMLElement($collection_stream); } catch (Exception $e) { if ($showError) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); } return NULL; } @@ -239,7 +239,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error Getting FormHandler: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error Getting FormHandler: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return NULL; } $formHandler = $xml->ingest_form; @@ -272,7 +272,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream for mime types !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting content model stream for mime types @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } foreach ($xml->mimetypes->type as $type) { @@ -302,7 +302,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting content model stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting content model stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } foreach ($xml->ingest_rules->rule as $rule) { @@ -365,7 +365,7 @@ class CollectionClass { try { $xml = new SimpleXMLElement($stream); } catch (Exception $e) { - drupal_set_message(t('Error getting ingest form stream !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting ingest form stream @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $docRoot = $_SERVER['DOCUMENT_ROOT']; @@ -451,7 +451,7 @@ class CollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error getting Next PID: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error getting Next PID: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $pid = implode(get_object_vars($object)); @@ -663,7 +663,7 @@ class CollectionClass { throw new Exception("Invalid XML."); } } catch (Exception $e) { - drupal_set_message(t('!e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return ''; } } diff --git a/ConnectionHelper.inc b/ConnectionHelper.inc index 71cca98d..59f811e2 100644 --- a/ConnectionHelper.inc +++ b/ConnectionHelper.inc @@ -71,7 +71,7 @@ class ConnectionHelper { 'exceptions' => $exceptions, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } @@ -83,7 +83,7 @@ class ConnectionHelper { 'exceptions' => TRUE, )); } catch (SoapFault $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage())))); return NULL; } } diff --git a/ObjectHelper.inc b/ObjectHelper.inc index ed3aec38..70f73d4b 100644 --- a/ObjectHelper.inc +++ b/ObjectHelper.inc @@ -386,7 +386,7 @@ class ObjectHelper { $input = new DomDocument(); $input->loadXML(trim($xmlstr)); } catch (exception $e) { - watchdog(t("Fedora_Repository"), "Problem loading XSL file: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("Fedora_Repository"), "Problem loading XSL file: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); } $xsl = $proc->importStylesheet($xsl); $newdom = $proc->transformToDoc($input); @@ -750,7 +750,7 @@ class ObjectHelper { try { $parent_collections = new SimpleXMLElement($parent_collections); } catch (exception $e) { - drupal_set_message(t('Error getting parent objects !e', array('!e' => check_plain($e->getMessage())))); + drupal_set_message(t('Error getting parent objects @e', array('@e' => check_plain($e->getMessage())))); return; } diff --git a/api/fedora_item.inc b/api/fedora_item.inc index a4ee923b..54a9158b 100644 --- a/api/fedora_item.inc +++ b/api/fedora_item.inc @@ -885,7 +885,7 @@ class Fedora_Item { drupal_set_message(t("Error trying to call SOAP function $function_name. Check watchdog logs for more information."), 'error'); } - watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error Trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } @@ -904,7 +904,7 @@ class Fedora_Item { } catch (exception $e) { if (!$quiet) { - watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function !fn: !e", array('!fn' => $function_name, '!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error trying to call SOAP function @fn: @e", array('@fn' => $function_name, '@e' => $e), NULL, WATCHDOG_ERROR); } return NULL; } diff --git a/api/tagging.inc b/api/tagging.inc index bfe4b844..418193fa 100644 --- a/api/tagging.inc +++ b/api/tagging.inc @@ -69,7 +69,7 @@ class TagSet { $this->item->modify_datastream_by_value($tagdoc->saveXML(), $this->tagsDSID, 'Tags', 'text/xml', 'X'); } } catch (exception $e) { - drupal_set_message(t('There was an error saving the tags datastream: !e'), array('!e' => $e), 'error'); + drupal_set_message(t('There was an error saving the tags datastream: @e'), array('@e' => $e), 'error'); return FALSE; } return TRUE; diff --git a/plugins/DarwinCore.inc b/plugins/DarwinCore.inc index 1071c5e0..2d66d60a 100644 --- a/plugins/DarwinCore.inc +++ b/plugins/DarwinCore.inc @@ -261,7 +261,7 @@ class DarwinCore { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } diff --git a/plugins/Flv.inc b/plugins/Flv.inc index 0e248b71..b5f159b2 100644 --- a/plugins/Flv.inc +++ b/plugins/Flv.inc @@ -69,7 +69,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -126,7 +126,7 @@ class FormBuilder { unlink($form_values['fullpath']); } } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } } diff --git a/plugins/FormBuilder.inc b/plugins/FormBuilder.inc index d44e1f9b..cd9dc4a9 100644 --- a/plugins/FormBuilder.inc +++ b/plugins/FormBuilder.inc @@ -68,7 +68,7 @@ class FormBuilder { $oai->appendChild($previousElement); } } catch (exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); continue; } } @@ -96,7 +96,7 @@ class FormBuilder { $xml = new SimpleXMLElement($policyStreamDoc); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem getting security policy."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem getting security policy: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Problem getting security policy: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); @@ -182,8 +182,8 @@ class FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/ModsFormBuilder.inc b/plugins/ModsFormBuilder.inc index 05ae0a99..aa0f6f92 100644 --- a/plugins/ModsFormBuilder.inc +++ b/plugins/ModsFormBuilder.inc @@ -316,8 +316,8 @@ class ModsFormBuilder extends FormBuilder { } file_delete($form_values['ingest-file-location']); } catch (exception $e) { - drupal_set_message(t('Error ingesting object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); - watchdog(t("Fedora_Repository"), "Error ingesting object: !e", array('!e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); + drupal_set_message(t('Error ingesting object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); + watchdog(t("Fedora_Repository"), "Error ingesting object: @e", array('@e' => check_plain($e->getMessage())), NULL, WATCHDOG_ERROR); return; } } diff --git a/plugins/PersonalCollectionClass.inc b/plugins/PersonalCollectionClass.inc index 6d5b0946..29c76cfa 100644 --- a/plugins/PersonalCollectionClass.inc +++ b/plugins/PersonalCollectionClass.inc @@ -57,7 +57,7 @@ class PersonalCollectionClass { $params )); } catch (exception $e) { - drupal_set_message(t('Error ingesting personal collection object: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Error ingesting personal collection object: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } return TRUE; @@ -76,7 +76,7 @@ class PersonalCollectionClass { $xml = new SimpleXMLElement($collectionTemplate); } catch (Exception $e) { watchdog(t("Fedora_Repository"), t("Problem creating personal collection policy, could not parse collection policy stream."), NULL, WATCHDOG_ERROR); - drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: !e', array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('Problem creating personal collection policy, could not parse collection policy stream: @e', array('@e' => check_plain($e->getMessage()))), 'error'); return FALSE; } $policyElement = $dom->createDocumentFragment(); diff --git a/plugins/Refworks.inc b/plugins/Refworks.inc index 0f3e908c..5e39b3c2 100644 --- a/plugins/Refworks.inc +++ b/plugins/Refworks.inc @@ -290,7 +290,7 @@ class Refworks { if ($client == NULL) { drupal_set_message(t('Error getting SOAP client.'), 'error'); - watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: !e", array('!e' => $e), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), "Error getting SOAP client: @e", array('@e' => $e), NULL, WATCHDOG_ERROR); return; } $object = $client->__soapCall('ingest', array( @@ -305,7 +305,7 @@ class Refworks { } catch (exception $e) { $errors++; $errorMessage = 'yes'; - watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it !e", array('!it' => $item_title, '!e' => $e)), NULL, WATCHDOG_ERROR); + watchdog(t("FEDORA_REPOSITORY"), t("Error during ingest !it @e", array('!it' => $item_title, '@e' => $e)), NULL, WATCHDOG_ERROR); } $success++; } diff --git a/plugins/ShowStreamsInFieldSets.inc b/plugins/ShowStreamsInFieldSets.inc index 23d5a4dc..a6e7eaad 100644 --- a/plugins/ShowStreamsInFieldSets.inc +++ b/plugins/ShowStreamsInFieldSets.inc @@ -183,7 +183,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return " "; } $xsl = new DomDocument(); @@ -237,7 +237,7 @@ class ShowStreamsInFieldSets { try { $proc = new XsltProcessor(); } catch (Exception $e) { - drupal_set_message(t("!e", array('!e' => check_plain($e->getMessage()))), 'error'); + drupal_set_message(t('@e', array('@e' => check_plain($e->getMessage()))), 'error'); return; } $xsl = new DomDocument();