Skip to content

Commit

Permalink
fix a bug in working vocabulary search
Browse files Browse the repository at this point in the history
  • Loading branch information
kouralex committed Jul 14, 2020
1 parent 583b950 commit af94269
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controller/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function invokeVocabularySearch($request)
try {
$vocabTypes = $this->model->getTypes($request->getVocabid(), $request->getLang());
} catch (Exception $e) {
header("HTTP/1.0 206 Partial Content");
header("HTTP/1.0 500 Internal Server Error");
if ($this->model->getConfig()->getLogCaughtExceptions()) {
error_log('Caught exception: ' . $e->getMessage());
}
Expand Down
2 changes: 1 addition & 1 deletion view/search-result.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<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 search_results and search_results|length == 0 %}<p class="no-results">{% trans 'The search provided no results.' %}</p>{% endif %}
{% if search_results is defined 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">
{% spaceless %}
Expand Down
8 changes: 4 additions & 4 deletions view/vocab-search-listing.twig
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
{% block content %}
<div class="search-result-listing">
{% include 'search-result.twig' %}
{% if not search_results and request.vocabid == 'null' and not global_search %}
{% if search_results is not defined and not global_search %}
<div class="alert alert-danger">
{% if request.vocabid == 'null' %}
<h4>{% trans %}Error: Requested vocabulary not found!{% endtrans %}</h4>
</div>
{% elseif not search_results and request.vocabid and not global_search %}
<div class="alert alert-danger">
{% else %}
<h4>{% trans %}Error: Search failed for vocabulary!{% endtrans %}</h4>
{% endif %}
</div>
{% endif %}
</div>
Expand Down

0 comments on commit af94269

Please sign in to comment.