Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292616

getDisplayLabel() on null in Drupal\profile\Entity\Profile->label() profile.php

$
0
0

HI all,

Normally I can find patches for these kind of "on null" errors, but I cannot find this one.
And I am not confident enough to start changing things in the code yet.

When I go to
Manage>People>Profiles

I get this error:

Error: Call to a member function getDisplayLabel() on null in Drupal\profile\Entity\Profile->label() (line 92 of /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/modules/contrib/profile/src/Entity/Profile.php)
#0 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/Entity/EntityBase.php(281): Drupal\profile\Entity\Profile->label()
#1 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/modules/contrib/profile/src/ProfileListBuilder.php(118): Drupal\Core\Entity\EntityBase->toLink()
#2 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/Entity/EntityListBuilder.php(235): Drupal\profile\ProfileListBuilder->buildRow(Object(Drupal\profile\Entity\Profile))
#3 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/Entity/Controller/EntityListController.php(23): Drupal\Core\Entity\EntityListBuilder->render()
#4 [internal function]: Drupal\Core\Entity\Controller\EntityListController->listing('profile')
#5 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#6 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#7 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#8 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#9 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#10 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#11 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#17 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#18 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /home/arbitil424/domains/struvaa.nl/public_html/Drupal8/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#20 {main}

Code that is causing the error

profile.php

 public function label() {
    $profile_type = ProfileType::load($this->bundle());
    $label = $this->t('@type #@id', [
      '@type' => $profile_type->getDisplayLabel() ?: $profile_type->label(),
      '@id' => $this->id(),
    ]);

Help and/or advice is most welcome!


Viewing all articles
Browse latest Browse all 292616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>