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

[5.6] Remove attribute filling from pivot model #23401

Merged
merged 2 commits into from
Mar 6, 2018
Merged

[5.6] Remove attribute filling from pivot model #23401

merged 2 commits into from
Mar 6, 2018

Conversation

staudenmeir
Copy link
Contributor

When querying a pivot relationship with a specified model (using()) the attributes are set using forceFill(), causing custom mutators to be called.

This is inconsistent with non-pivot models and also unnecessary, since the values are immediately overwritten with the raw attributes.

Fixes #23234.

@jmarcher
Copy link
Contributor

jmarcher commented Mar 6, 2018

Do not change the tests, add new tests instead.

@staudenmeir
Copy link
Contributor Author

I replaced the test because it didn't seem to test double mutation, since there aren't any mutators in the model stub.

Also, having tests called testFromRawAttributesDoesNotDoubleMutate and testFromRawAttributesDoesNotMutate makes little sense.

@taylorotwell taylorotwell merged commit 8bfcf52 into laravel:5.6 Mar 6, 2018
@sylvain-gaffie-sociomantic
Copy link
Contributor

Hi,

Any chance this could be merged into 5.5?
Migrating to 5.6 requires php 7.1+.

I am not sure about how you guys handle previous versions...
Thank you.

taylorotwell pushed a commit that referenced this pull request Mar 15, 2018
* Remove attribute filling from pivot model

* Re-add test
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.

5 participants