Skip to content

Commit

Permalink
Show a nicer message when a SQL error occurs.
Browse files Browse the repository at this point in the history
  • Loading branch information
gsoules committed Feb 19, 2024
1 parent 40fcdd8 commit c989f35
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion views/public/css/avantsearch.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@

#no-results p {
position: absolute;
margin-top: 0px;
margin-top: 0;
}

#no-results-error {
margin-top: 24px;
color: #777;
font-weight: bold;
}

#no-results-error-sql {
margin-top: 12px;
color: #777;
font-weight: normal;
}

#search-filter-form {
Expand Down
10 changes: 8 additions & 2 deletions views/public/table-view.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,19 @@
?>
<?php else: ?>
<div id="no-results">
<p>
<div id="no-results-error">
<?php
$error = $searchResults->getError();
if (!empty($error))
{
echo '<hr>';
echo '<div>' . __("Your keyword(s) caused a search error. This can happen if they contain unrecognized punctuation.") . '</div>';
echo '<div id="no-results-error-sql">';
echo $error;
echo '</div>';
}
?>
</p>
</div>
</div>
<?php endif; ?>
<?php
Expand Down

0 comments on commit c989f35

Please # to comment.