Call to a member function getColumns() on bool (Filter path.alias)

Created on 5 February 2025, 24 days ago

Problem/Motivation

When I try to filter for the β€˜path.alias’ in the JSON:API, I get the following error message

Error:

"Error: Call to a member function getColumns() on bool in /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Tables.php:246\nStack trace:\n#0 /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(58): Drupal\\Core\\Entity\\Query\\Sql\\Tables->addField('path.alias', 'INNER', NULL)\n#1 /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Condition.php(53): Drupal\\Core\\Entity\\Query\\Sql\\Condition->compile(Object(Drupal\\Core\\Database\\Query\\Condition))\n#2 /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(177): Drupal\\Core\\Entity\\Query\\Sql\\Condition->compile(Object(Drupal\\mysql\\Driver\\Database\\mysql\\Select))\n#3 /var/www/html/docroot/core/lib/Drupal/Core/Entity/Query/Sql/Query.php(82): Drupal\\Core\\Entity\\Query\\Sql\\Query->compile()\n#4 /var/www/html/docroot/core/modules/jsonapi/src/Controller/EntityResource.php(508): Drupal\\Core\\Entity\\Query\\Sql\\Query->execute()\n#5 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\\jsonapi\\Controller\\EntityResource->Drupal\\jsonapi\\Controller\\{closure}()\n#6 /var/www/html/docroot/core/modules/jsonapi/src/Controller/EntityResource.php(507): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#7 /var/www/html/docroot/core/modules/jsonapi/src/Controller/EntityResource.php(422): Drupal\\jsonapi\\Controller\\EntityResource->executeQueryInRenderContext(Object(Drupal\\Core\\Entity\\Query\\Sql\\Query), Object(Drupal\\Core\\Cache\\CacheableMetadata))\n#8 [internal function]: Drupal\\jsonapi\\Controller\\EntityResource->getCollection(Object(Drupal\\jsonapi_extras\\ResourceType\\ConfigurableResourceType), Object(Symfony\\Component\\HttpFoundation\\Request))\n#9 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)\n#10 /var/www/html/docroot/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#11 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\\Core\\Render\\Renderer->executeInRenderContext(Object(Drupal\\Core\\Render\\RenderContext), Object(Closure))\n#12 /var/www/html/docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)\n#13 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\\Core\\EventSubscriber\\EarlyRenderingControllerWrapperSubscriber->Drupal\\Core\\EventSubscriber\\{closure}()\n#14 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#15 /var/www/html/docroot/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#17 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#18 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#19 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\ContentLength->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#20 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#21 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#22 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\\Stack\\Cors->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#23 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#24 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#25 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#26 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#27 /var/www/html/docroot/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#28 {main}\n\nNext Symfony\\Component\\HttpKernel\\Exception\\HttpException: Call to a member function getColumns() on bool in /var/www/html/docroot/core/modules/jsonapi/src/EventSubscriber/DefaultExceptionSubscriber.php:49\nStack trace:\n#0 [internal function]: Drupal\\jsonapi\\EventSubscriber\\DefaultExceptionSubscriber->onException(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#1 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...', Object(Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher))\n#2 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(239): Drupal\\Component\\EventDispatcher\\ContainerAwareEventDispatcher->dispatch(Object(Symfony\\Component\\HttpKernel\\Event\\ExceptionEvent), 'kernel.exceptio...')\n#3 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(91): Symfony\\Component\\HttpKernel\\HttpKernel->handleThrowable(Object(Error), Object(Symfony\\Component\\HttpFoundation\\Request), 1)\n#4 /var/www/html/docroot/modules/contrib/simple_oauth/src/HttpMiddleware/BasicAuthSwap.php(68): Symfony\\Component\\HttpKernel\\HttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#5 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Drupal\\simple_oauth\\HttpMiddleware\\BasicAuthSwap->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#6 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\\Core\\StackMiddleware\\Session->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#7 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\\Core\\StackMiddleware\\KernelPreHandle->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#8 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\\Core\\StackMiddleware\\ContentLength->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#9 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\\page_cache\\StackMiddleware\\PageCache->pass(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#10 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\\page_cache\\StackMiddleware\\PageCache->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#11 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\\Stack\\Cors->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#12 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\\Core\\StackMiddleware\\ReverseProxyMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#13 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\\Core\\StackMiddleware\\NegotiationMiddleware->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#14 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\\Core\\StackMiddleware\\AjaxPageState->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#15 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\\Core\\StackMiddleware\\StackedHttpKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request), 1, true)\n#16 /var/www/html/docroot/index.php(19): Drupal\\Core\\DrupalKernel->handle(Object(Symfony\\Component\\HttpFoundation\\Request))\n#17 {main}"

Steps to reproduce

- Install path_alias module.
- Go to the JSON:API (See route below)
- https:///jsonapi/node/article?filter[path.alias][value]=/

πŸ› Bug report
Status

Active

Version

1.13

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany PLK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @PLK
  • πŸ‡©πŸ‡ͺGermany PLK
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland

    That has nothing to do with this module. path is a computed field without storage, you can't query on that. Doesn't work with or without this module and can't be fixed, at best it could provide a better error, but that's something that core would have to do.

Production build 0.71.5 2024