Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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