don't lazy eager load nested cards #17732
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Similar to #17470, in some cases, the lazy eager loading for the nested matrix cards was only finding elements owned by the first nested entry. I tried a few other solutions, but those that made it work as expected resulted in the same number of queries as with
eagerly()
removed.Steps to reproduce:
matrixCards
), all default settings; with an entry type that can contain just the default title field (forMatrixCards
)matrixBlocks
), all default settings; with an entry type that contains the default title field and thematrixCards
field; thematrixCards
field needs to be mandatoryblog
) with an entry type (article
) that contains the default title field and thematrixBlocks
fieldblog
section; fill out the title, add 2 blocks to thematrixBlocks
field, fill out the title for both blocks and add at least onematrixCards
nested entry to each; fully saveblog
entry from the previous step; remove the title from the firstmatrixBlock
block, wait for autosave to complete and then try to fully save; when the page reloads the secondmatrixBlocks
block will be empty; if you reload the page, the nested entries for that second block are backRelated issues
n/a - reported by @olivierbon