This pull fixes #89, a nasty issue triggered by IMI and Context being deployed on the same system. We fix it on this side since as the issue explain, Context is not to blame, its how Islandora loosely asumes Abstract Objects have methods that are not required and then copy pasta leads to this.
I added a new Class and a new relationships class to fakeObject that only responds to certain expected methods with real data, allowing the Context reaction to at least happen. I can't say what will happen if that reaction removes or alters Datastreams, but at least on this side we are dealing with the implementation.
How to test?
Either switch to this branch (issue-89) or apply the patch as Github recommends.
You can either try this live or run the following code in a development PHP box
module_load_include('inc', 'islandora', 'includes/tuque_wrapper');
module_load_include('inc', 'islandora_multi_importer', 'includes/FakeObject');
// THIS PIECE IS IMI
$islandora_object = new FakeObject("imi:faker", array("islandora:collectionCMode, islandora:sp_simple_image"));
// THIS PIECE IS CONTEXT, IF NO ERROR THEM I SOLVED IT
if (is_object($islandora_object) && property_exists($islandora_object, "id") ) {
$cmodels = $islandora_object->relationships->get("info:fedora/fedora-system:def/model#", "hasModel");
print_r($cmodels);
$islandora_object_cmodels = array();
foreach ($cmodels as $cmodel) {
$islandora_object_cmodels[] = $cmodel["object"]["value"];
}
dpm($islandora_object_cmodels);
if (!in_array("islandora:collectionCModel", $islandora_object_cmodels)) {
print_r("not collection, actually it is, but proves the point");
} else {
print_r("is a collection");
}
}
Which is a test case for showing how IMI now allows for Context to read Fake Objects correctly.
This pull fixes #89, a nasty issue triggered by IMI and Context being deployed on the same system. We fix it on this side since as the issue explain, Context is not to blame, its how Islandora loosely asumes Abstract Objects have methods that are not required and then copy pasta leads to this.
I added a new Class and a new relationships class to fakeObject that only responds to certain expected methods with real data, allowing the Context reaction to at least happen. I can't say what will happen if that reaction removes or alters Datastreams, but at least on this side we are dealing with the implementation.
How to test?
Either switch to this branch (issue-89) or apply the patch as Github recommends. You can either try this live or run the following code in a development PHP box
Which is a test case for showing how IMI now allows for Context to read Fake Objects correctly.
Disclaimer: this is an exception, IMI is flexible, but not as flexible as other module's code/expectations or assumptions of what an Abstract Object is or not is https://github.com/Islandora/tuque/blob/ceaa130ab092dbad9d3c37073cba4575687d63ea/Object.php#L39
Once this is tested, please let me know if all is ok to merge it. Enjoy!
@McFateM @kromabiles @jmignault