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

Allow any casting done in Type::validate to bubble up to Request::retrieveValue #16525

Merged
merged 1 commit into from
Feb 15, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 13, 2020

Overview

The validate function returns

  • NULL if the passed in value is not valid
  • THe passed in value if valid or
  • The passed in value cast to an integer if the value is valid and the type is Int or Integer

By always using the returned value we allow it to be cast, where appropriate

Before

Valid integer returned as string

After

Valid integer returned as integer

Technical Details

Comments

…rieveValue

The validate function returns
- NULL if the passed in value is not valid
- THe passed in value if valid or
 - The passed in value cast to an integer if the value is valid and the type is Int or Integer

By always using the returned value we allow it to be cast, where appropriate
@civibot
Copy link

civibot bot commented Feb 13, 2020

(Standard links)

@civibot civibot bot added the master label Feb 13, 2020
@eileenmcnaughton eileenmcnaughton changed the title Allow any casting done in Type::validate to bubble up to Request::ret… Allow any casting done in Type::validate to bubble up to Request::retrieveValue Feb 13, 2020
@eileenmcnaughton
Copy link
Contributor Author

Note this is currently blocking #16480

@mattwire
Copy link
Contributor

I'm happy with this

@mattwire mattwire merged commit b9d5ed4 into civicrm:master Feb 15, 2020
@eileenmcnaughton eileenmcnaughton deleted the validate branch February 15, 2020 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants