You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple example: Loading categories from Shopware API, children array is empty, even with child categories in Shopware.
Example categories in Shopware are: "Home" and 12 child categories: "Bäume", "Sträucher", "Bodendecker" etc.
Count: 13
Category-ID:018e84ee474e73fdbe3c7e74717acecc, Name: Home
Category-ID:018f86ee17a97a83aa229b36903cf952, Name: Bäume
no childs
Category-ID:018f86ee7ac772a7b4b93b1cd19c1bbf, Name: Sträucher
no childs
Category-ID:018f86ee80ff7ed989aa2aa7dfc0ddb3, Name: Bodendecker
no childs
Category-ID:018f86ee9a337ae4abad16e97e2eb3d9, Name: Heckenpflanzen
no childs
Category-ID:018f86eeb0db750a8b5118b195a3fc93, Name: Wasserpflanzen
no childs
Category-ID:018f86eeca2271d0b4e337ed212b2a27, Name: Kräuter
no childs
Category-ID:018f86eedaf171c9bf5cd6a047adac4e, Name: Stauden
no childs
Category-ID:018f86eeeb5279f081c59b67b67a4947, Name: Blumenzwiebeln
no childs
Category-ID:018f86ef08f072868c97c4ccd085f8db, Name: Kletterpflanzen
no childs
Category-ID:018f86ef1f1d7e7383ad7ceec97fab2a, Name: Obstgehölze
no childs
Category-ID:018f86ef4bfa7610902d5b9876908222, Name: Ziergehölze
no childs
Category-ID:018f86ef5a2e7c0ab515c67dcc3cc1a5, Name: Zimmerpflanzen
no childs
The first children array should contain the child categories of "Home", but it is empty.
But if I change setLimit to (10) I got this:
Count: 10
Category-ID:018e84ee474e73fdbe3c7e74717acecc, Name: Home
Child-Category-ID:018f86ef1f1d7e7383ad7ceec97fab2a, Name: Obstgehölze
Child-Category-ID:018f86ef4bfa7610902d5b9876908222, Name: Ziergehölze
Child-Category-ID:018f86ef5a2e7c0ab515c67dcc3cc1a5, Name: Zimmerpflanzen
Category-ID:018f86ee17a97a83aa229b36903cf952, Name: Bäume
no childs
Category-ID:018f86ee7ac772a7b4b93b1cd19c1bbf, Name: Sträucher
no childs
Category-ID:018f86ee80ff7ed989aa2aa7dfc0ddb3, Name: Bodendecker
no childs
Category-ID:018f86ee9a337ae4abad16e97e2eb3d9, Name: Heckenpflanzen
no childs
Category-ID:018f86eeb0db750a8b5118b195a3fc93, Name: Wasserpflanzen
no childs
Category-ID:018f86eeca2271d0b4e337ed212b2a27, Name: Kräuter
no childs
Category-ID:018f86eedaf171c9bf5cd6a047adac4e, Name: Stauden
no childs
Category-ID:018f86eeeb5279f081c59b67b67a4947, Name: Blumenzwiebeln
no childs
Category-ID:018f86ef08f072868c97c4ccd085f8db, Name: Kletterpflanzen
no childs
And if I only load the first category with setLimit(1), all children are included.
Possible reason?
In the response from Shopware, the "included" key only includes category objects, which are not already in the "data" key. And the hydrateToMany function only hydrate the "included" json objects.
This is maybe very special, because the included entities are from the same type (both Category). But this can also occur in other requests with linked entities from same type, like in products.
Or did I missed something?
Thanks and best regards
Kai
The text was updated successfully, but these errors were encountered:
Kai-Dittberner
changed the title
Missing associated entities in repository requests with limit set
Missing associated entities with same type in repository requests
Jun 16, 2024
Simple example: Loading categories from Shopware API, children array is empty, even with child categories in Shopware.
Example categories in Shopware are: "Home" and 12 child categories: "Bäume", "Sträucher", "Bodendecker" etc.
If I load the categories with paging like this:
The result looks like
The first children array should contain the child categories of "Home", but it is empty.
But if I change setLimit to (10) I got this:
And if I only load the first category with setLimit(1), all children are included.
Possible reason?
In the response from Shopware, the "included" key only includes category objects, which are not already in the "data" key. And the hydrateToMany function only hydrate the "included" json objects.
This is maybe very special, because the included entities are from the same type (both Category). But this can also occur in other requests with linked entities from same type, like in products.
Or did I missed something?
Thanks and best regards
Kai
The text was updated successfully, but these errors were encountered: