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

[8.x] Fix sometimes conditions that add rules for sibling values within an array of data #38899

Merged
merged 4 commits into from
Sep 23, 2021

Conversation

NickSdot
Copy link
Contributor

@taylorotwell Hotfix and tests for #38443 (comment)

@NickSdot
Copy link
Contributor Author

@jasonlewis do you wanna give it a quick try?

@jasonlewis
Copy link
Contributor

Hey mate I'll hopefully give it a whirl tomorrow morning (Australia) if Taylor hasn't already gotten around to it. Cheers!

@taylorotwell
Copy link
Member

taylorotwell commented Sep 22, 2021

The difference after your original PR @NickSdot is that the $implicitAttributes property on the validator is not hydrated properly when sometimes is used in certain situations.

I pushed a new commit to this PR to address that as I think it is the root cause - I also added another test that was failing without my fix.

@taylorotwell
Copy link
Member

Also good to see you @jasonlewis ❤️

@jasonlewis
Copy link
Contributor

Cheers fellas! Can confirm this fixed our cases (tests are now green across the board). Much appreciated and sorry I couldn't help much more.

Hope all is well @taylorotwell! 😄

@@ -4392,6 +4392,18 @@ public function testValidateSometimesImplicitEachWithAsterisksBeforeAndAfter()
});
$this->assertTrue($v->passes());

return;
Copy link
Contributor

@BrandonSurowiec BrandonSurowiec Sep 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this return supposed to be here? Seems like it is exiting the test case prematurely.

@taylorotwell taylorotwell merged commit 74ad9ec into laravel:8.x Sep 23, 2021
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
…in an array of data (laravel#38899)

* Hotfix for laravel#38443 (comment)

* Fix style

* fix bug

* Update ValidationValidatorTest.php

Co-authored-by: Taylor Otwell <[email protected]>
Co-authored-by: Taylor Otwell <[email protected]>
@NickSdot NickSdot deleted the sometimes-bug branch June 10, 2023 05:22
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.

4 participants