The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated.

Created on 24 June 2024, 3 months ago
Updated 23 July 2024, 2 months ago

Problem/Motivation

I'm receiving this error on 10.3.0 and latest configuration inspector

Full stack trace


LogicException
Symfony\Component\Validator\Exception\LogicException:
The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated.

  at /var/www/html/web/core/lib/Drupal/Core/Config/Plugin/Validation/Constraint/LangcodeRequiredIfTranslatableValuesConstraintValidator.php:26
  at Drupal\Core\Config\Plugin\Validation\Constraint\LangcodeRequiredIfTranslatableValuesConstraintValidator->validate()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php:202)
  at Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateConstraints()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php:154)
  at Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php:164)
  at Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveContextualValidator.php:106)
  at Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/Validation/RecursiveValidator.php:93)
  at Drupal\Core\TypedData\Validation\RecursiveValidator->validate()
     (/var/www/html/web/core/lib/Drupal/Core/TypedData/TypedData.php:132)
  at Drupal\Core\TypedData\TypedData->validate()
     (/var/www/html/web/modules/contrib/config_inspector/src/ConfigInspectorManager.php:355)
  at Drupal\config_inspector\ConfigInspectorManager->validateValues()
     (/var/www/html/web/modules/contrib/config_inspector/src/Controller/ConfigInspectorController.php:176)
  at Drupal\config_inspector\Controller\ConfigInspectorController->overview()
  at call_user_func_array()
     (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:123)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
     (/var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php:638)
  at Drupal\Core\Render\Renderer->executeInRenderContext()
     (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:121)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext()
     (/var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php:97)
  at Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (/var/www/html/vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php:53)
  at Drupal\Core\StackMiddleware\Session->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php:48)
  at Drupal\Core\StackMiddleware\KernelPreHandle->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php:28)
  at Drupal\Core\StackMiddleware\ContentLength->handle()
     (/var/www/html/web/core/modules/big_pipe/src/StackMiddleware/ContentLength.php:32)
  at Drupal\big_pipe\StackMiddleware\ContentLength->handle()
     (/var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:106)
  at Drupal\page_cache\StackMiddleware\PageCache->pass()
     (/var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php:85)
  at Drupal\page_cache\StackMiddleware\PageCache->handle()
     (/var/www/html/web/core/modules/ban/src/BanMiddleware.php:50)
  at Drupal\ban\BanMiddleware->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php:48)
  at Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
     (/var/www/html/web/modules/contrib/tracer/src/StackMiddleware/TracesMiddleware.php:38)
  at Drupal\tracer\StackMiddleware\TracesMiddleware->handle()
     (/var/www/html/web/modules/contrib/webprofiler/src/StackMiddleware/WebprofilerMiddleware.php:42)
  at Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php:51)
  at Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php:36)
  at Drupal\Core\StackMiddleware\AjaxPageState->handle()
     (/var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php:51)
  at Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
     (/var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php:741)
  at Drupal\Core\DrupalKernel->handle()
     (/var/www/html/web/index.php:19)  

Steps to reproduce

Proposed resolution

Don't throw a fatal error but point out what config is wrong

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Needs work

Version

2.1

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States smustgrave

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

Comments & Activities

Production build 0.71.5 2024