Skip to content
Snippets Groups Projects
Commit 59b07e29 authored by André Lahmann's avatar André Lahmann
Browse files

refs #4577:

* added check for availability of hierarchical parent to Solr-TreeDataSource
* added configuration option for availability check to HierarchyTree inis
parent 7b5fff7e
No related merge requests found
......@@ -27,4 +27,10 @@ fullHierarchyRecordView = true
; Filter queries filter what kind of children are displayed in the tree
; Note: The hidden filters from searches.ini are applied as well
; Note: Only applies when treeSource = Solr
;filterQueries[] = "-relsext.hasModel:\"DataModel\" AND -relsext.hasModel:\"ListCollection\""
\ No newline at end of file
;filterQueries[] = "-relsext.hasModel:\"DataModel\" AND -relsext.hasModel:\"ListCollection\""
; Check whether the hierarchy_parent_id and hierarchy_top_id records are
; available in the index. If a referenced parent_id or top_id does not
; exist the frontend will show HierarchyTree layout-elements but will
; hang on acutally building the HierarchyTree.
; (default = true)
checkAvailability = true
\ No newline at end of file
......@@ -24,3 +24,9 @@ show = false
; (true = show full hierarchy, false = only show path to current selected node,
; default = true)
;fullHierarchyRecordView = true
; Check whether the hierarchy_parent_id and hierarchy_top_id records are
; available in the index. If a referenced parent_id or top_id does not
; exist the frontend will show HierarchyTree layout-elements but will
; hang on acutally building the HierarchyTree.
; (default = true)
checkAvailability = true
\ No newline at end of file
......@@ -228,6 +228,20 @@ class Solr extends AbstractBase
*/
public function supports($id)
{
$settings = $this->hierarchyDriver->getTreeSettings();
if (isset($settings['checkAvailability']) && $settings['checkAvailability']==1) {
$query = new Query(
'id:"' . addcslashes($id, '"') . '"'
);
$results = $this->searchService->search(
'Solr', $query, 0, 10000,
new ParamBag(array('fq' => $this->filters, 'hl' => 'false'))
);
if ($results->getTotal() < 1) {
return false;
}
}
// Assume all IDs are supported.
return true;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment