-
Notifications
You must be signed in to change notification settings - Fork 820
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 load fields if lazy ones exists #6604
FIX load fields if lazy ones exists #6604
Conversation
f77a410
to
e862f76
Compare
src/ORM/DataObject.php
Outdated
$tableClass = $this->record[$fieldName . '_Lazy']; | ||
$this->loadLazyFields($tableClass); | ||
|
||
$value = isset($this->record[$fieldName]) ? $this->record[$fieldName] : null; |
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 think we do need to investigate how a $field . '_Lazy'
can still be unset after calling loadLazyFields
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.
!$value
matches false. would suggest using !isset($this->record[$fieldName])
in this if block instead, and moving the value-setter on line 2724 to below this if clause. then line 2732 isn't needed.
src/ORM/DataObject.php
Outdated
$tableClass = $this->record[$fieldName . '_Lazy']; | ||
$this->loadLazyFields($tableClass); | ||
|
||
$value = isset($this->record[$fieldName]) ? $this->record[$fieldName] : null; |
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.
!$value
matches false. would suggest using !isset($this->record[$fieldName])
in this if block instead, and moving the value-setter on line 2724 to below this if clause. then line 2732 isn't needed.
e862f76
to
b8a0944
Compare
Reordered as per @sminnee recommendations - failing test is the code coverage one. |
Resolves #6603
Bonus test for good measure.