Saving a blank Person contact breaks the admin/content/crm/contact page

Created on 20 August 2025, about 2 months ago

Problem/Motivation

I managed to brick my Person contact list by submitting a blank contact. Here's the error I get whenever I try accessing the admin/content/crm/contact page after reproducing the bug:

The website encountered an unexpected error. Try again later.

TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, null given, called in /var/www/html/web/core/lib/Drupal/Core/Utility/LinkGenerator.php on line 199 in Drupal\Component\Utility\Html::escape() (line 433 of core/lib/Drupal/Component/Utility/Html.php).
Drupal\Core\Utility\LinkGenerator->doGenerate() (Line: 181)
Drupal\Core\Utility\LinkGenerator->generate() (Line: 104)
Drupal\Core\Render\Element\Link::preRenderLink()
call_user_func_array() (Line: 107)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 876)
Drupal\Core\Render\Renderer->doCallback() (Line: 438)
Drupal\Core\Render\Renderer->doRender() (Line: 227)
Drupal\Core\Render\Renderer->render() (Line: 491)
Drupal\Core\Template\TwigExtension->escapeFilter() (Line: 184)
__TwigTemplate_7cd77fa5fee03ed2ec54c01155ec7f3e->doDisplay() (Line: 402)
Twig\Template->yield() (Line: 358)
Twig\Template->display() (Line: 373)
Twig\Template->render() (Line: 51)
Twig\TemplateWrapper->render() (Line: 34)
twig_render_template() (Line: 380)
Drupal\Core\Theme\ThemeManager->render() (Line: 497)
Drupal\Core\Render\Renderer->doRender() (Line: 510)
Drupal\Core\Render\Renderer->doRender() (Line: 510)
Drupal\Core\Render\Renderer->doRender() (Line: 227)
Drupal\Core\Render\Renderer->render() (Line: 242)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 627)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 235)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 131)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray() (Line: 246)
Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}() (Line: 206)
Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (Line: 56)
Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (Line: 188)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 53)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 715)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Steps to reproduce

1) I did a fresh install of the project (technically modifying it so everything was called crm2), since this bug made my first instance unusable. Not sure if this is necessary, but if you're struggling to recreate try a fresh install.
2) Do the steps described in this bug: https://www.drupal.org/project/crm/issues/3542118 🐛 Submitting a Blank Person Contact causes a "Argument #1 ($text) must be of type string, null given" error Active
3) Access the admin/content/crm/contact page - you should see the error

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇨🇦Canada speckles

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

Comments & Activities

Production build 0.71.5 2024