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

Fixes the required_if messages if multiple values are passed #5262

Merged
merged 1 commit into from Sep 8, 2014

Conversation

mohitmamoria
Copy link
Contributor

Closed the previous pull request #5260. This contains the rebased code.

When passing in multiple values in required_if (like so: required_if:type,mobile,email) for a attribute in rules, then the error message always showed errors with the first value ('mobile' in this case) replaced in the message string. This was due to the following code in Illuminate\Validation\Validator line 1799:

$parameters[1] = $this->getDisplayableValue($parameters[0], $parameters[1]);

But, error can be generated by any value in the rule (by 'mobile' or by 'email'). This pull request fixes the problem and also adds a test to verify the same.

added test to check required_if with multiple values

moved the test to proper method
taylorotwell added a commit that referenced this pull request Sep 8, 2014
Fixes the required_if messages if multiple values are passed
@taylorotwell taylorotwell merged commit fd6bfa4 into laravel:4.2 Sep 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants