Skip to content

Commit

Permalink
Remove warning message about skipped vocabs (too obtrusive and the us…
Browse files Browse the repository at this point in the history
…er can't do anything about it)
  • Loading branch information
osma committed Sep 9, 2021
1 parent c777186 commit ee5e40f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
16 changes: 0 additions & 16 deletions controller/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,21 +344,6 @@ public function invokeGlobalSearch($request)
}
$parameters->setVocabularies($vocabObjects);

$nondefaultEndpointVocs = array();

if (sizeOf($vocabObjects) != 1) {
// global search, either from all (sizeOf($vocabObjects) == 0) or from selected ones
if (empty($vocabObjects)) {
$vocabObjects = $this->model->getVocabularies();
}
$defaultEndpoint = $this->model->getConfig()->getDefaultEndpoint();
foreach($vocabObjects as $voc) {
if ($voc->getEndpoint() !== $defaultEndpoint) {
$nondefaultEndpointVocs[] = $voc;
}
}
}

$counts = null;
$searchResults = null;
$errored = false;
Expand Down Expand Up @@ -386,7 +371,6 @@ public function invokeGlobalSearch($request)
'rest' => $parameters->getOffset()>0,
'global_search' => true,
'search_failed' => $errored,
'skipped_vocabs' => $nondefaultEndpointVocs,
'term' => $request->getQueryParamRaw('q'),
'lang_list' => $langList,
'vocabs' => str_replace(' ', '+', $vocabs),
Expand Down
8 changes: 0 additions & 8 deletions view/search-result.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@
<div class="search-count{% if limit_type or limit_parent or limit_group or limit_scheme %} search-limited{% endif %}"><p>{% trans %}{{ search_count }} results for '{{ term }}'{% endtrans %}{% if limit_type %}, {% trans "limited to type" %} '{% for type in limit_type %}{{ type }}{% if loop.last == false %}, {% endif %}{% endfor %}'{% endif %}{% if limit_parent %}, {% trans "limited to parent" %} '{{ limit_parent }}'{% endif %}{% if limit_group %}, {% trans "limited to group" %} '{{ limit_group }}'{% endif %}{% if limit_scheme %}, {% trans "limited to scheme" %} '{% for scheme in limit_scheme %}{{ scheme }}{% if loop.last == false %}, {% endif %}{% endfor %}'{% endif %}</p>
</div>{% if limit_type or limit_parent or limit_group or limit_scheme %}<button type="button" class="btn btn-default" id="remove-limits">{% trans "Clear limitations" %}</button>{% endif %}
{% endif %}
{% if global_search and not search_failed and skipped_vocabs|length > 0 %}
<div class="alert alert-warning">
{% for voc in skipped_vocabs %}
{% set vocTitle = voc.title %}
<h4>{% trans %}Warning: Skipped searching from '{{vocTitle}}' vocabulary!{% endtrans %}</h4>
{% endfor %}
</div>
{% endif %}
{% if search_results is not null and search_results|length == 0 %}<p class="no-results">{% trans 'The search provided no results.' %}</p>{% endif %}
{% for concept in search_results %} {# loop through the hits #}
<div class="search-result">
Expand Down

0 comments on commit ee5e40f

Please sign in to comment.