Skip to content

Commit

Permalink
sidebar navigation now works after erroneous page; fixes #721
Browse files Browse the repository at this point in the history
(cherry picked from commit 4ab7ba3)
  • Loading branch information
kouralex authored and osma committed Sep 7, 2021
1 parent 3d05609 commit 363fe28
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
11 changes: 9 additions & 2 deletions model/Vocabulary.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,15 @@ public function getConceptRelateds($uri, $lang)
public function getConceptInfo($uri, $clang)
{
$sparql = $this->getSparql();

return $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
$conceptInfo = null;
try {
$conceptInfo = $sparql->queryConceptInfo($uri, $this->config->getArrayClassURI(), array($this), $clang);
} catch (EasyRdf\Http\ExceptionEasyRdf\ExceptionException | Throwable $e) {
if ($this->model->getConfig()->getLogCaughtExceptions()) {
error_log('Caught exception: ' . $e->getMessage());
}
}
return $conceptInfo;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions resource/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ ul.dropdown-menu > li:last-child > input {
margin: 15px;
}

.search-result-listing > .alert > h4 {
margin: 10px 0px;
}

.search-result-listing .search-count {
text-align: left;
margin-left: 15px;
Expand Down Expand Up @@ -1212,6 +1216,10 @@ li.sub-group {
line-height: 1.1;
}

.page-alert > h3 {
margin: 10px 0px;
}

.search-result-listing .deprecated-alert {
margin-left: 10px;
color: #D95F8A;
Expand Down
8 changes: 6 additions & 2 deletions view/error-page.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{% extends "light.twig" %}
{% block title %}: Error page{% endblock %}
{% block error %}
<div class="alert {% if request.vocabid != '' or request.page == 'feedback' or request.page == 'about' %}page-alert{% else %}frontpage-alert{% endif %}">
<h3>{% if not message %}{% trans %}404 Error: The page {{ requested_page }} cannot be found.{% endtrans %}{% else %}{{ message }}{% endif %}</h3>
<div id="maincontent">
<div class="content">
<div class="alert {% if request.vocabid != '' or request.page == 'feedback' or request.page == 'about' %}page-alert{% else %}frontpage-alert{% endif %}">
<h3>{% if not message %}{% trans %}404 Error: The page {{ requested_page }} cannot be found.{% endtrans %}{% else %}{{ message }}{% endif %}</h3>
</div>
</div>
</div>
{% endblock %}

0 comments on commit 363fe28

Please sign in to comment.