Error: Call to a member function getBundleInfo() on null in StrawSelection->getReferenceableEntities()

Created on 18 February 2021, almost 4 years ago
Updated 1 June 2024, 7 months ago

Installed and configured the module on Drupal 9. I get the following error anytime something is entered in autocomplete field (does not wor):

Error: Call to a member function getBundleInfo() on null in Drupal\straw\Plugin\EntityReferenceSelection\StrawSelection->getReferenceableEntities() (Zeile 30 in /var/www/myproject/web/modules/contrib/straw/src/Plugin/EntityReferenceSelection/StrawSelection.php)
#0 /var/www/myproject/web/core/lib/Drupal/Core/Entity/EntityAutocompleteMatcher.php(47): Drupal\straw\Plugin\EntityReferenceSelection\StrawSelection->getReferenceableEntities('e', 'CONTAINS', 10)
#1 /var/www/myproject/web/core/modules/system/src/Controller/EntityAutocompleteController.php(102): Drupal\Core\Entity\EntityAutocompleteMatcher->getMatches('taxonomy_term', 'straw', Array, 'e')
#2 [internal function]: Drupal\system\Controller\EntityAutocompleteController->handleAutocomplete(Object(Symfony\Component\HttpFoundation\Request), 'taxonomy_term', 'straw', 'wqkFAGO_5Xsqq1-...')
#3 /var/www/myproject/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#4 /var/www/myproject/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#5 /var/www/myproject/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#6 /var/www/myproject/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#7 /var/www/myproject/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#8 /var/www/myproject/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#9 /var/www/myproject/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /var/www/myproject/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#11 /var/www/myproject/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /var/www/myproject/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /var/www/myproject/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/myproject/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /var/www/myproject/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/myproject/web/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /var/www/myproject/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#18 {main}
.
🐛 Bug report
Status

Closed: works as designed

Version

1.3

Component

Code

Created by

🇦🇹Austria drupalfan2

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇹Portugal jcnventura

    That code is basically copy-paste from core's core/modules/taxonomy/src/Plugin/EntityReferenceSelection/TermSelection.php, which that class extends.

    If core is fine with the current logic, so am I.

Production build 0.71.5 2024