Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

hasOne relation via() is not working as expected #52

Open
papppeter opened this issue Aug 6, 2019 · 0 comments
Open

hasOne relation via() is not working as expected #52

papppeter opened this issue Aug 6, 2019 · 0 comments
Assignees

Comments

@papppeter
Copy link

papppeter commented Aug 6, 2019

it creates new linking all the time, if i am populating it from a POST.

becouse of this: (line 279)
$relationModel = null; if (!empty($fks)) { $relationModel = $modelClass::findOne($fks); }

it creates a new instance
than (line 664)
if ($this->_oldRelationValue[$relationName] !== $owner->{$relationName}) {
will be false all the time. it links again, whenever it was a existing relation or not.

i am using php7.1

@nstCactus nstCactus self-assigned this Mar 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants