diff --git a/includes/breadcrumb.inc b/includes/breadcrumb.inc index e75a0fdd..e3eb2782 100644 --- a/includes/breadcrumb.inc +++ b/includes/breadcrumb.inc @@ -91,6 +91,7 @@ function islandora_get_breadcrumbs_recursive($pid, FedoraRepository $repository, !optionals !filters } + !order EOQ; $query_optionals = (array) module_invoke('islandora_xacml_api', 'islandora_basic_collection_get_query_optionals', 'view'); @@ -98,10 +99,14 @@ EOQ; $filter_map = function ($filter) { return "FILTER($filter)"; }; - $query_filters[] = "sameTerm(?collection_predicate, ) || sameTerm(?collection_predicate, )"; + $collection_predicate_filters = "sameTerm(?collection_predicate, )"; + $collection_predicate_filters .= " || sameTerm(?collection_predicate, ) || sameTerm(?collection_predicate, )"; + $query_filters[] = $collection_predicate_filters; + $query_order = "ORDER BY DESC(?label)"; $query = format_string($query, array( '!optionals' => !empty($query_optionals) ? ('OPTIONAL {{' . implode('} UNION {', $query_optionals) . '}}') : '', '!filters' => implode(' ', array_map($filter_map, $query_filters)), + '!order' => $query_order, )); $query = format_string($query, array( '!pid' => $pid,