|
|
@ -154,7 +154,8 @@ function islandora_manage_orphaned_objects_confirm_submit(array $form, array &$f |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function islandora_get_orphaned_objects() { |
|
|
|
function islandora_get_orphaned_objects() { |
|
|
|
$query_method = variable_get('islandora_orphaned_objects_backend', 'SPARQL'); |
|
|
|
$query_method = variable_get('islandora_orphaned_objects_backend', 'SPARQL'); |
|
|
|
|
|
|
|
$root_pid = variable_get('islandora_repository_pid', 'islandora:root'); |
|
|
|
|
|
|
|
$root_pid_check = "info:fedora/" . $root_pid; |
|
|
|
if ($query_method == 'Solr') { |
|
|
|
if ($query_method == 'Solr') { |
|
|
|
// Solr query for all objects. |
|
|
|
// Solr query for all objects. |
|
|
|
$collection_field = variable_get('islandora_solr_member_of_collection_field', 'RELS_EXT_isMemberOfCollection_uri_ms'); |
|
|
|
$collection_field = variable_get('islandora_solr_member_of_collection_field', 'RELS_EXT_isMemberOfCollection_uri_ms'); |
|
|
@ -197,6 +198,7 @@ function islandora_get_orphaned_objects() { |
|
|
|
foreach ($results as $result) { |
|
|
|
foreach ($results as $result) { |
|
|
|
if (array_key_exists($collection_field, $result['solr_doc'])) { |
|
|
|
if (array_key_exists($collection_field, $result['solr_doc'])) { |
|
|
|
foreach ($result['solr_doc'][$collection_field] as $collection) { |
|
|
|
foreach ($result['solr_doc'][$collection_field] as $collection) { |
|
|
|
|
|
|
|
if (($result['PID'] != $root_pid) && ($collection != $root_pid_check)) { |
|
|
|
if (in_array($collection, $missing_parents)) { |
|
|
|
if (in_array($collection, $missing_parents)) { |
|
|
|
$orphaned_objects[] = $result; |
|
|
|
$orphaned_objects[] = $result; |
|
|
|
} |
|
|
|
} |
|
|
@ -210,6 +212,7 @@ function islandora_get_orphaned_objects() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (array_key_exists($member_field, $result['solr_doc'])) { |
|
|
|
if (array_key_exists($member_field, $result['solr_doc'])) { |
|
|
|
foreach ($result['solr_doc'][$member_field] as $membership) { |
|
|
|
foreach ($result['solr_doc'][$member_field] as $membership) { |
|
|
|
if (in_array($membership, $missing_parents)) { |
|
|
|
if (in_array($membership, $missing_parents)) { |
|
|
|