PHP 8.1 - Deprecated function: strlen(): Passing null to parameter in EntityVisualInlineDiffLayout->buildRevisionData

Created on 24 March 2023, over 1 year ago

Problem/Motivation

Getting the following warnings when comparing revisions:

 Deprecated function: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Component\Utility\Unicode::validateUtf8() (line 477 of core/lib/Drupal/Component/Utility/Unicode.php).
Drupal\Component\Utility\Unicode::validateUtf8(NULL) (Line: 65)
Drupal\Component\Utility\Xss::filter(NULL) (Line: 19)
Drupal\entity_diff_ui\Plugin\diff\Layout\EntityVisualInlineDiffLayout->buildRevisionData(Object) (Line: 132)
Drupal\diff\DiffLayoutBase->buildRevisionsData(Object, Object) (Line: 74)
Drupal\entity_diff_ui\Plugin\diff\Layout\EntityVisualInlineDiffLayout->build(Object, Object, Object) (Line: 168)
Drupal\diff\Controller\PluginRevisionController->compareEntityRevisions(Object, Object, Object, 'visual_inline') (Line: 49)
Drupal\diff\Controller\NodeRevisionController->compareNodeRevisions(Object, Object, Object, 'visual_inline')
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Steps to reproduce

  • Ensure Drupal is running on PHP 8.1
  • Install diff and entity_diff_ui module
  • Create a node
  • Make changes to the node
  • Go to the revisions tab click 'Compare revisions button'
  • Notice the error
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇳India shabana.navas

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

Comments & Activities

Production build 0.71.5 2024