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

When attribute has multiple times the same rule, only the last one is validated #17

Closed
torrentalle opened this issue May 18, 2015 · 10 comments
Assignees
Labels
Milestone

Comments

@torrentalle
Copy link
Member

When attribute has multiple times the same rule, only the last one is validated

In this case, for the attribute distributor_city_id the rule required_if:type,distributor is not validated

$rules=[
     'distributor_city_id' => 'required_if:type,distributor|required_if:house,myhome',
     'distributor_name_id' => 'required_if:type,distributor',
     'type' => 'alpha',
     'house' => 'alpha',
];
@torrentalle torrentalle self-assigned this May 18, 2015
torrentalle pushed a commit that referenced this issue May 19, 2015
torrentalle added a commit that referenced this issue May 19, 2015
Issue #17 - When attribute has multiple times the same rule, only the last one is validated
@torrentalle torrentalle added this to the 1.1.0 milestone May 21, 2015
@dennisoderwald
Copy link

Issue not resolved :(

@torrentalle
Copy link
Member Author

You have to publish the new Javascript files to apply the patches

php  artisan vendor:publish --provider="Proengsoft\JsValidation\JsValidationServiceProvider" --tag="public" --force

I'm preparing a new release with this bug an others solved,

@dennisoderwald
Copy link

I republished the new Javascript files - bug is not resolved.. :(

@dennisoderwald
Copy link

@torrentalle: We release a new version today, can u help us?

@dennisoderwald
Copy link

We use dev-master ac28943 - the bug already exists.

@torrentalle
Copy link
Member Author

Did you republished Javascripts files after composer update?
Can you post your rules?
I'm trying this case and I'm getting correct results:

$rules=[
     'distributor_city_id' => 'required_if:type,distributor|required_if:house,myhome',
     'distributor_name_id' => 'required_if:type,distributor',
     'type' => 'alpha',
     'house' => 'alpha',
];

When field house='myhome' I get the error The distributor city id field is required when house is myhome.

When field type='distributor' I get the error The distributor city id field is required when type is distributor. and The distributor name id field is required when type is distributor.

@dennisoderwald
Copy link

@torrentalle: Do you use Skype to write directly?

@dennisoderwald
Copy link

Did you republished Javascripts files after composer update?

Of course.

Our rule-set:

        'payment_method'           => 'required|in:credit_card,sepa_debit',
        'credit_card_holder_name'  => 'required_if:payment_method,credit_card',
        'credit_card_no'           => 'required_if:payment_method,credit_card',
        'credit_card_expire_month' => 'required_if:payment_method,credit_card',
        'credit_card_expire_year'  => 'required_if:payment_method,credit_card',
        'credit_card_cvc'          => 'required_if:payment_method,credit_card',

@torrentalle
Copy link
Member Author

The problem is related to radio buttons In dev-master this bug is fixed
May be other checks ar affected by the same bug. I will review the code

@torrentalle
Copy link
Member Author

This bug is fixed in master branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants