-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fixes InvalidArgumentException (#16362) #18763
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
Conversation
…able in a loadInto call
| $expected = $table->get(2, contain: ['Articles.Authors']); | ||
| $this->assertEquals($expected, $entity); |
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.
Should we also have an assertion on the contained associations being present in both results?
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.
Added
|
shoudln't this go into 4.x and get merged upstream or will this be backported to 4.x? |
|
If it exists in main, we usually always fix first there, and then backport where needed. |
* Fixes InvalidArgumentException when joining and containing the same table in a loadInto call * Fix phpcs Errors * Add assertions on article and author in TableTest::testloadBelongsToDoubleJoin --------- Co-authored-by: Erik Nagelkerke <[email protected]>
* Fixes InvalidArgumentException (#16362) (#18763) * Fixes InvalidArgumentException when joining and containing the same table in a loadInto call * Fix phpcs Errors * Add assertions on article and author in TableTest::testloadBelongsToDoubleJoin --------- Co-authored-by: Erik Nagelkerke <[email protected]> * Fix finder syntax --------- Co-authored-by: Eriknag <[email protected]> Co-authored-by: Erik Nagelkerke <[email protected]>
I also came across the issue described in #16362
The error happens when you contain a table that was joined earlier on.
In my case the join was added in the findAll method and performed a check on deleted items.
E.g. When an article is set to deleted I want to prevent it's comments from being loaded as well.
And later on, when I used loadInto, it gave the exception.
It also happens when you add a join in the contain options, so that's how I decided to test it.