Skip to content
Snippets Groups Projects
Commit c6ae94bd authored by eileen's avatar eileen
Browse files

Remove last instance of CRM_Core_Error::fatal....

parent 18252270
Branches
Tags
No related merge requests found
......@@ -63,15 +63,13 @@ class CRM_Utils_Request {
* Default value of the variable if not present.
* @param string $method
* Where to look for the variable - 'GET', 'POST' or 'REQUEST'.
* @param bool $isThrowException
* Should a an exception be thrown rather than a fatal.
*
* @return mixed
* The value of the variable
*
* @throws \CRM_Core_Exception
*/
public static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $default = NULL, $method = 'REQUEST', $isThrowException = TRUE) {
public static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $default = NULL, $method = 'REQUEST') {
$value = NULL;
switch ($method) {
......@@ -97,10 +95,7 @@ class CRM_Utils_Request {
}
if (!isset($value) && $abort) {
if ($isThrowException) {
throw new CRM_Core_Exception(ts("Could not find valid value for %1", [1 => $name]));
}
CRM_Core_Error::fatal(ts("Could not find valid value for %1", [1 => $name]));
throw new CRM_Core_Exception(ts('Could not find valid value for %1', [1 => $name]));
}
if (!isset($value) && $default) {
......@@ -108,7 +103,7 @@ class CRM_Utils_Request {
}
// minor hack for action
if ($name == 'action') {
if ($name === 'action') {
if (!is_numeric($value) && is_string($value)) {
$value = CRM_Core_Action::resolve($value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment