Browse Source

Changed in response to ISLANDORA-200

pull/105/head
Alan Stanley 14 years ago
parent
commit
c300933192
  1. 4
      CollectionPolicy.inc
  2. 10
      XMLDatastream.inc
  3. 33
      ilives/fedora_ilives.test

4
CollectionPolicy.inc

@ -33,7 +33,7 @@ class CollectionPolicy extends XMLDatastream {
static function loadFromCollection($pid, $preFetch=TRUE) {
$ret = FALSE;
module_load_include('inc', 'fedora_repository', 'api/fedora_item');
try {
if (self::validPid($pid)) {
$dsid=CollectionPolicy::getDefaultDSID();
@ -133,7 +133,7 @@ class CollectionPolicy extends XMLDatastream {
*/
public static function ingestBlankPolicy($pid, $name, $policyDsid, $model_pid, $model_namespace, $relationship, $searchField, $searchValue) {
$ret = FALSE;
if (($cp = self::loadFromCollection($pid, $modelDsid)) === FALSE) {
if (($cp = self::loadFromCollection($pid )) === FALSE) { //removed second, non-existant variable
module_load_include('inc', 'fedora_repository', 'ContentModel');
if (($cm = ContentModel::loadFromModel($model_pid)) !== FALSE && $cm->validate()) {
$newDom = new DOMDocument('1.0', 'utf-8');

10
XMLDatastream.inc

@ -92,11 +92,17 @@ abstract class XMLDatastream {
*/
public function __construct($xmlStr, $pid = NULL, $dsid = NULL) {
libxml_use_internal_errors(true);
$this->pid = $pid;
$this->dsid = $dsid;
if ($xmlStr !== NULL) {
$this->xml = (is_object($xmlStr) && get_class($xmlStr) == DOMDocument) ? $xmlStr : DOMDocument::loadXML($xmlStr);
if(is_object($xmlStr) && get_class($xmlStr) == 'DOMDocument'){
$this->xml = $xmlStr;
}else{
$this->xml = new DOMDocument('1.0', 'iso-8859-1');
$this->xml->loadXML($xmlStr);
}
}
}

33
ilives/fedora_ilives.test

@ -1,33 +0,0 @@
<?php
class fedoraBookTestCase extends DrupalWebTestCase {
public static function getInfo() {
return array(
'name' => 'Fedora Ilives',
'description' => t('The Fedora repository book module.'),
'group' => t('fedora repository'),
);
}
protected function setUp() {
parent::setUp('fedora_ilives', 'fedora_repository');
// Create and login user.
$drupal_user = $this->drupalCreateUser(array('add fedora datastreams',
'edit fedora meta data',
'edit tags datastream',
'ingest new fedora objects',
'purge objects and datastreams',
'view fedora collection'));
$this->drupalLogin($drupal_user);
}
public function testFedoraIlives() {
// Initially we are just testing that the module installs successfully from a clean Drupal. ISLANDORA-165.
$this->pass(drupal_get_path('module', 'fedora_ilives'));
}
}
Loading…
Cancel
Save