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 allowing context refs on some string, number and date methods #654

Merged
merged 4 commits into from
May 23, 2015
Merged

Fix allowing context refs on some string, number and date methods #654

merged 4 commits into from
May 23, 2015

Conversation

zebateira
Copy link
Contributor

Invoking the following methods:

  • number: min, max, less and greater
  • string: min, max and length
  • data: max and min

with e.g. Joi.ref('$a') causes the error: Cannot read property 'context' of undefined at lib/ref.js:19:256

The validation options where not being passed to the ref validation function, so only normal refs were working, but not context refs.

carsy added 4 commits May 23, 2015 13:42
The validation options were not being passed to the validation function.
This fixes the number compare functions: min, max, less and greater.
The validation options were not being passed to the validation function.
This fixes the string compare functions: min, max and length.
The validation options were not being passed to the validation function.
This fixes the date compare functions: min and max.
The validation options were not being passed to the validation function and this merge fixes the following methods when they receive a context ref, e.g, Joi.ref('$a'):

 - number: min, max, less and greater
 - string: min, max and length
 - data: max and min
@Marsup Marsup added the bug Bug or defect label May 23, 2015
@Marsup Marsup self-assigned this May 23, 2015
@Marsup Marsup added this to the 6.4.2 milestone May 23, 2015
Marsup added a commit that referenced this pull request May 23, 2015
Fix allowing context refs on some string, number and date methods
@Marsup Marsup merged commit 841183e into hapijs:master May 23, 2015
@Marsup
Copy link
Collaborator

Marsup commented May 23, 2015

Thanks !

@zebateira
Copy link
Contributor Author

My pleasure. Thank you for the quick merge and publish 👍

@filipediasf
Copy link

Awesome! 👍

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants