-
Notifications
You must be signed in to change notification settings - Fork 46
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 Field clone with Reference and do not mutate model scope in Condition::toWords #865
Conversation
39833ab
to
b2c8626
Compare
8dfa926
to
2363941
Compare
2363941
to
78debc5
Compare
I am looking into it but it will be a challenge. |
3426f9e
to
4bfd093
Compare
I added a quickfix now. The issue will be resolved when #867 is closed |
@georgehristov thanks, I fixed the Field cloning issue #867 as well as your have proposed. |
public function getReference(): ?Reference | ||
{ | ||
return $this->referenceLink !== null | ||
? $this->getOwner()->getRef($this->referenceLink) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to check if getOwner()
is set, as Field with reference is created always with a model. If not, invoking getOwner
will throw. :)
Now we need to modify |
fixes #867 and https://github.com/atk4/data/blob/2.4.0/src/Model/Scope/Condition.php#L356 issue as well - Scope must not mutate Model in any sense, if something is desired to be set to gather data, it must be done on clone.
BC break:
Field::reference
property was removed, replaced byField::getReference()
method.