From d276979548ff0ede989035944aa472f83d20019b Mon Sep 17 00:00:00 2001 From: willtp87 Date: Wed, 25 Feb 2015 10:44:39 -0400 Subject: [PATCH] Stopped a notice. --- islandora.rules.inc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/islandora.rules.inc b/islandora.rules.inc index 2562656a..2ebaa519 100644 --- a/islandora.rules.inc +++ b/islandora.rules.inc @@ -406,9 +406,11 @@ function islandora_rules_datastream_load_namespace_vocab($xpath, $xpath_vocab) { /** * Rules XPath helper; grab the datastream content and build a DOMXPath. */ -function islandora_rules_datastream_load_xpath(AbstractDatastream $datastream, $xpath_vocab) { - $result = islandora_rules_datastream_load_domxpath($datastream->content, $xpath_vocab); - islandora_rules_datastream_load_namespace_vocab($result['islandora_domxpath'], $xpath_vocab); +function islandora_rules_datastream_load_xpath(AbstractDatastream $datastream, $xpath_vocab = NULL) { + $result = islandora_rules_datastream_load_domxpath($datastream->content); + if (is_object($xpath_vocab)) { + islandora_rules_datastream_load_namespace_vocab($result['islandora_domxpath'], $xpath_vocab); + } return $result; }