Skip to content

Commit

Permalink
Issue 62: Create a fake iterator for our fake Object (#105)
Browse files Browse the repository at this point in the history
* Update FakeObject to match Iterator expectations

This should fix ISSUE #62
There is an issue with OHSP where the derivative triggering process tries (and does so) array push datastreams in place, which is wrong.
As stated there
https://github.com/Islandora/tuque/blob/ceaa130ab092dbad9d3c37073cba4575687d63ea/Object.php#L901-L903
Setting an offset is not the way, since you really want create a new datastream instead of pushing. But, anyway, we want this to play well. We will have to revision more times than expected this fakerObject class, since its only purpose is to allow Needed derivatives to be listed during the IMI setup and not to be used to add/remove Datastreams, there is already a CMODEL hook (see TECHMD) where you can add new Datstreams to an existing CMODEL without tinkering on existing objects.

* Coding Standard
  • Loading branch information
DiegoPino authored Aug 27, 2019
1 parent c03a350 commit 8cb4ece
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions includes/FakeObject.inc
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,28 @@ class FakeObject extends AbstractObject {
* {@inheritdoc}
*/
public function offsetExists($offset) {

return FALSE;
}

/**
* {@inheritdoc}
*/
public function offsetSet($offset, $value) {

return FALSE;
}

/**
* {@inheritdoc}
*/
public function offsetGet($offset) {

return FALSE;
}

/**
* {@inheritdoc}
*/
public function offsetUnset($offset) {

return FALSE;
}

/**
Expand All @@ -98,7 +98,7 @@ class FakeObject extends AbstractObject {
* {@inheritdoc}
*/
public function getIterator() {

return new ArrayIterator(array());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/import.form.inc
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ function islandora_multi_importer_cmodeldsmapping_form(array &$form_state, array
$computed_cmodels[$cmodel] += array(
"$new_dsdi" => array(
'id' => $new_dsdi,
'mime'=> array(),
'mime' => array(),
'optional' => 1
)
);
Expand Down

0 comments on commit 8cb4ece

Please sign in to comment.