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

Fix calls to Request::retrieve #16526

Merged
merged 1 commit into from
Feb 14, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 13, 2020

Overview

Minor cleanup on calls to Request::retrieve

Before

Default params passed in, in some instances $_REQUEST is passed in - which is invalid but equivalent to not passing anything in. In some cases NULL object passed in

After

Where the defaults for the signature is used they are not also passed in

  public static function retrieve($name, $type, &$store = NULL, $abort = FALSE, $default = NULL, $method = 'REQUEST', $isThrowException = TRUE)

Technical Details

Do not pass in values that are set by default. Use retrieveValue rather than passing in the NULL object

Comments

@seamuslee001 I found more instances than this but didn't want to create a big PR that would be a pain to review - however, the thing I was searching for was whether the last parameter ($useException) is ever false - with a view to removing it if not. My searching suggests it can go

Do not pass in values that are set by default. Use retrieveValue  rather than passing inn the NULL object
@civibot
Copy link

civibot bot commented Feb 13, 2020

(Standard links)

@civibot civibot bot added the master label Feb 13, 2020
@eileenmcnaughton
Copy link
Contributor Author

test this please

@seamuslee001 seamuslee001 merged commit 5e63a8a into civicrm:master Feb 14, 2020
@seamuslee001 seamuslee001 deleted the valid_calls branch February 14, 2020 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants