-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
Hi!
It looks like the url generated for the subquery drops the "filters" attribute on Generator/UrlGenerator.php:275 in symfony/routing v4.2.10 (but I guess it should impact all versions) :
if ($extra && $query = http_build_query($extra, '', '&', PHP_QUERY_RFC3986)) {
$extra does have a key 'filters' with an array 'entity.id' => [], but http_build_query seems to not like empty array and does'nt put filters in its query (see https://stackoverflow.com/questions/2930592/http-build-query-ignores-the-key-if-the-value-is-an-empty-array-how-is-this-not).
A quick and dirty fix would be to replace, in src/Helper/EmbeddedListHelper.php:144 (v2.1.6) :
return ['entity.id' => $itemIds->toArray()];
by
$array = $itemIds->toArray();
if(empty($array)) {
$array = [0];
}
return ['entity.id' => $array];
... but only works if we're sure to never have entities with "0" id.
Thanks to all contributor of this bundle 👍
botjaeger
Metadata
Metadata
Assignees
Labels
No labels