Skip to content
Snippets Groups Projects
Commit 1ebbf789 authored by Demian Katz's avatar Demian Katz
Browse files

Eliminated obsolete RequestParseErrorException.

parent 753eed65
No related merge requests found
......@@ -234,17 +234,19 @@ class AbstractSearch extends AbstractBase
if ($this->resultScrollerActive()) {
$this->resultScroller()->init($results);
}
} catch (\VuFindSearch\Backend\Exception\RequestParseErrorException $e) {
// If it's a parse error or the user specified an invalid field, we
// should display an appropriate message:
$view->parseError = true;
// We need to create and process an "empty results" object to
// ensure that recommendation modules and templates behave
// properly when displaying the error message.
$view->results = $this->getResultsManager()->get('EmptySet');
$view->results->setParams($params);
$view->results->performAndProcessSearch();
} catch (\VuFindSearch\Backend\Exception\BackendException $e) {
if ($e->hasTag('VuFind\Search\ParserError')) {
// If it's a parse error or the user specified an invalid field, we
// should display an appropriate message:
$view->parseError = true;
// We need to create and process an "empty results" object to
// ensure that recommendation modules and templates behave
// properly when displaying the error message.
$view->results = $this->getResultsManager()->get('EmptySet');
$view->results->setParams($params);
$view->results->performAndProcessSearch();
}
}
// Save statistics:
if ($this->logStatistics) {
......
<?php
/**
* RequestParseErrorException.
*
* PHP version 5
*
* Copyright (C) Villanova University 2010.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* @category VuFind2
* @package Search
* @author David Maus <maus@hab.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org
*/
namespace VuFindSearch\Backend\Exception;
/**
* RequestParseErrorException.
*
* Signals an error parsing the syntax of the user-supplied search criteria.
*
* @category VuFind2
* @package Search
* @author David Maus <maus@hab.de>
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License
* @link http://vufind.org
*/
class RequestParseErrorException extends RequestErrorException
{
}
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