- 🇮🇳India dinesh_kesarkar
Hi grimreaper,
getting this error for Boolean field added in node entity. I am using field_test_boolean = 1 filter but still giving Invalid nested filtering error.
Thanks, Dinesh
I have updated a (server) site, from Drupal 8.6.x to 8.7.3 and from entity_share 1.0.x to 2.0.0.alpha2. When I select a channel on a client site (Drupal 8.7.3. entity_share 2.0.0.alpha2), then I get on the server site the following error message:
Drupal\Core\Http\Exception\CacheableBadRequestHttpException: Invalid nested filtering. The field `field_myfield`, given in the path `field_myfield` is incomplete, it must end with one of the following specifiers: `id`. in Drupal\jsonapi\Context\FieldResolver->resolveInternalEntityQueryPath() (Zeile 364 in /var/www/html/core/modules/jsonapi/src/Context/FieldResolver.php).
The get request looks like: http://mysite.docker/jsonapi/node/article?filter%5Bfield_myfield%5D%5Bco...
If I make the request in postman, then I get:
{
"jsonapi": {
"version": "1.0",
"meta": {
"links": {
"self": {
"href": "http://jsonapi.org/format/1.0/"
}
}
}
},
"errors": [
{
"title": "Bad Request",
"status": "400",
"detail": "Invalid nested filtering. The field `field_myfield`, given in the path `field_myfield` is incomplete, it must end with one of the following specifiers: `id`.",
"links": {
"via": {
"href": "http://mysite.docker/jsonapi/node/article?filter%5Bfield_myfield%5D%5Bcondition%5D%5BmemberOf%5D=mychannel&filter%5Bfield_myfield%5D%5Bcondition%5D%5Boperator%5D=%3D&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bpath%5D=5Bfield_myfield&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bvalue%5D=230&filter%5Bsomefilter%5D%5Bgroup%5D%5Bconjunction%5D=AND&page%5Boffset%5D=0"
},
"info": {
"href": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"
}
},
"source": {
"file": "/var/www/html/core/modules/jsonapi/src/Context/FieldResolver.php",
"line": 364
},
"meta": {
"exception": "Drupal\\Core\\Http\\Exception\\CacheableBadRequestHttpException: Invalid nested filtering. The field `field_myfield`, given in the path `field_myfield` is incomplete, it must end with one of the following specifiers: `id`. in /var/www/html/core/modules/jsonapi/src/Context/FieldResolver.php:364\nStack trace:\n#0 /var/www/html/core/modules/jsonapi/src/Query/Filter.php(160): Drupal\\jsonapi\\Context\\FieldResolver->resolveInternalEntityQueryPath('node', 'article', 'field_myfield')\n#1 /var/www/html/core/modules/jsonapi/src/Controller/EntityResource.php(1197): Drupal\\jsonapi\\Query\\Filter::createFromQueryParameter(Array, Object(Drupal\\jsonapi_extras\\ResourceType\\ConfigurableResourceType), Object(Drupal\\jsonapi\\Context\\FieldResolver))\n#2 /var/www/html/core/modules/jsonapi/src/Controller/EntityResource.php(378): Drupal\\jsonapi\\Controller\\EntityResource->getJsonApiParams(Object(Symfony\\Component\\HttpFoundation\\Request), Object(Drupal\\jsonapi_extras\\ResourceType\\ConfigurableResourceType))\n#3 [internal function]: Drupal\\jsonapi\\Controller\\EntityResource->getCollection(Object(Drupal\\jsonapi_extras\\ResourceType\\ConfigurableResourceType), Object(Symfony\\Component\\HttpFoundation\\Request))\n#4 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#5 /var/www/html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#6 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#7 /var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#8 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#9 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#10 /var/www/html/modules/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(67): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 /var/www/html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /var/www/html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /var/www/html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 /var/www/html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /var/www/html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /var/www/html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/www/html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/www/html/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#20 {main}",
"trace": [
{
"file": "/var/www/html/core/modules/jsonapi/src/Query/Filter.php",
"line": 160,
"function": "resolveInternalEntityQueryPath",
"class": "Drupal\\jsonapi\\Context\\FieldResolver",
"type": "->",
"args": [
"node",
"article",
"field_myfield"
]
},
{
"file": "/var/www/html/core/modules/jsonapi/src/Controller/EntityResource.php",
"line": 1197,
"function": "createFromQueryParameter",
"class": "Drupal\\jsonapi\\Query\\Filter",
"type": "::",
"args": [
{
"somefilter": {
"group": {
"conjunction": "AND"
}
},
"field_myfield": {
"condition": {
"path": "field_myfield",
"operator": "=",
"value": "230",
"memberOf": "somefilter"
}
}
},
null,
null
]
},
{
"file": "/var/www/html/core/modules/jsonapi/src/Controller/EntityResource.php",
"line": 378,
"function": "getJsonApiParams",
"class": "Drupal\\jsonapi\\Controller\\EntityResource",
"type": "->",
"args": [
"GET /jsonapi/node/article?filter%5Bsomefilter%5D%5Bgroup%5D%5Bconjunction%5D=AND&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bpath%5D=field_myfield&filter%5Bfield_myfield%5D%5Bcondition%5D%5Boperator%5D=%3D&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bvalue%5D=230&filter%5Bfield_myfield%5D%5Bcondition%5D%5BmemberOf%5D=somefilter&page%5Boffset%5D=0 HTTP/1.1\r\nAccept-Encoding: gzip\r\nAuthorization: Basic cHVibGlzaGVlOnB1Ymxpc2hlZQ==\r\nContent-Type: application/vnd.api+json\r\nHost: publish.develop.docker\r\nPhp-Auth-Pw: somelogin\r\nPhp-Auth-User: somelogin\r\nUser-Agent: Drupal/8.7.3 (+https://www.drupal.org/) GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.3.6\r\nX-Forwarded-For: 10.255.3.200\r\nX-Forwarded-Host: publish.develop.docker\r\nX-Forwarded-Port: 80\r\nX-Forwarded-Proto: http\r\nX-Forwarded-Server: 36c8098bfca6\r\nX-Php-Ob-Level: 0\r\nX-Real-Ip: 10.255.3.200\r\n\r\n",
null
]
},
{
"function": "getCollection",
"class": "Drupal\\jsonapi\\Controller\\EntityResource",
"type": "->",
"args": [
null,
"GET /jsonapi/node/article?filter%5Bssomefilter%5D%5Bgroup%5D%5Bconjunction%5D=AND&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bpath%5D=field_myfield&filter%5Bfield_myfield%5D%5Bcondition%5D%5Boperator%5D=%3D&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bvalue%5D=230&filter%5Bfield_myfield%5D%5Bcondition%5D%5BmemberOf%5D=somefilter&page%5Boffset%5D=0 HTTP/1.1\r\nAccept-Encoding: gzip\r\nAuthorization: Basic cHVibGlzaGVlOnB1Ymxpc2hlZQ==\r\nContent-Type: application/vnd.api+json\r\nHost: publish.develop.docker\r\nPhp-Auth-Pw: somelogin\r\nPhp-Auth-User: somelogin\r\nUser-Agent: Drupal/8.7.3 (+https://www.drupal.org/) GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.3.6\r\nX-Forwarded-For: 10.255.3.200\r\nX-Forwarded-Host: publish.develop.docker\r\nX-Forwarded-Port: 80\r\nX-Forwarded-Proto: http\r\nX-Forwarded-Server: 36c8098bfca6\r\nX-Php-Ob-Level: 0\r\nX-Real-Ip: 10.255.3.200\r\n\r\n"
]
},
{
"file": "/var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php",
"line": 123,
"function": "call_user_func_array",
"args": [
[
null,
"getCollection"
],
[
null,
"GET /jsonapi/node/aricle?filter%5Bsomefilter%5D%5Bgroup%5D%5Bconjunction%5D=AND&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bpath%5D=field_myfield&filter%5Bfield_myfield%5D%5Bcondition%5D%5Boperator%5D=%3D&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bvalue%5D=230&filter%5Bfield_myfield%5D%5Bcondition%5D%5BmemberOf%5D=somefilter&page%5Boffset%5D=0 HTTP/1.1\r\nAccept-Encoding: gzip\r\nAuthorization: Basic cHVibGlzaGVlOnB1Ymxpc2hlZQ==\r\nContent-Type: application/vnd.api+json\r\nHost: publish.develop.docker\r\nPhp-Auth-Pw: somelogin\r\nPhp-Auth-User: somelogin\r\nUser-Agent: Drupal/8.7.3 (+https://www.drupal.org/) GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.3.6\r\nX-Forwarded-For: 10.255.3.200\r\nX-Forwarded-Host: publish.develop.docker\r\nX-Forwarded-Port: 80\r\nX-Forwarded-Proto: http\r\nX-Forwarded-Server: 36c8098bfca6\r\nX-Php-Ob-Level: 0\r\nX-Real-Ip: 10.255.3.200\r\n\r\n"
]
]
},
{
"file": "/var/www/html/core/lib/Drupal/Core/Render/Renderer.php",
"line": 582,
"function": "Drupal\\Core\\EventSubscriber\\{closure}",
"class": "Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber",
"type": "->",
"args": []
},
{
"file": "/var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php",
"line": 124,
"function": "executeInRenderContext",
"class": "Drupal\\Core\\Render\\Renderer",
"type": "->",
"args": [
null,
null
]
},
{
"file": "/var/www/html/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php",
"line": 97,
"function": "wrapControllerExecutionInRenderContext",
"class": "Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber",
"type": "->",
"args": [
[
null,
"getCollection"
],
[
null,
"GET /jsonapi/node/article?filter%5Bsomefilter%5D%5Bgroup%5D%5Bconjunction%5D=AND&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bpath%5D=field_myfield&filter%5Bfield_myfield%5D%5Bcondition%5D%5Boperator%5D=%3D&filter%5Bfield_myfield%5D%5Bcondition%5D%5Bvalue%5D=230&filter%5Bfield_myfield%5D%5Bcondition%5D%5BmemberOf%5D=somefilter&page%5Boffset%5D=0 HTTP/1.1\r\nAccept-Encoding: gzip\r\nAuthorization: Basic cHVibGlzaGVlOnB1Ymxpc2hlZQ==\r\nContent-Type: application/vnd.api+json\r\nHost: publish.develop.docker\r\nPhp-Auth-Pw: somelogin\r\nPhp-Auth-User: somelogin\r\nUser-Agent: Drupal/8.7.3 (+https://www.drupal.org/) GuzzleHttp/6.3.3 curl/7.52.1 PHP/7.3.6\r\nX-Forwarded-For: 10.255.3.200\r\nX-Forwarded-Host: publish.develop.docker\r\nX-Forwarded-Port: 80\r\nX-Forwarded-Proto: http\r\nX-Forwarded-Server: 36c8098bfca6\r\nX-Php-Ob-Level: 0\r\nX-Real-Ip: 10.255.3.200\r\n\r\n"
]
]
},
...
]
}
}
]
}
Closed: cannot reproduce
2.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Hi grimreaper,
getting this error for Boolean field added in node entity. I am using field_test_boolean = 1 filter but still giving Invalid nested filtering error.
Thanks, Dinesh