Skip to content

Commit

Permalink
Merge pull request #17550 from eileenmcnaughton/request
Browse files Browse the repository at this point in the history
Remove last instance of CRM_Core_Error::fatal....
  • Loading branch information
eileenmcnaughton authored Jun 8, 2020
2 parents 5d73950 + c6ae94b commit fad01bf
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions CRM/Utils/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,13 @@ public static function id() {
* 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) {
Expand All @@ -97,18 +95,15 @@ public static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $d
}

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) {
$value = $default;
}

// minor hack for action
if ($name == 'action') {
if ($name === 'action') {
if (!is_numeric($value) && is_string($value)) {
$value = CRM_Core_Action::resolve($value);
}
Expand Down

0 comments on commit fad01bf

Please sign in to comment.