Function maxlength_field_widget_third_party_settings_form() should return array, not null

Created on 15 June 2025, about 2 months ago

Function maxlength_field_widget_third_party_settings_form() should return array.

Please check function hook_field_widget_third_party_settings_form() definition.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇷🇸Serbia super_romeo Belgrade

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

Merge Requests

Comments & Activities

  • Issue created by @super_romeo
  • 🇮🇳India divyansh.gupta Jaipur

    Working on it!!

  • 🇮🇳India divyansh.gupta Jaipur

    Yes i agree that if there is nothing to show then also it should return an array, thus made the required changes.
    Please review!!

  • Pipeline finished with Success
    about 1 month ago
    Total: 309s
    #531013
  • 🇷🇸Serbia super_romeo Belgrade

    Thank you, @divyansh.gupta!
    Works as expected :)

  • 🇺🇸United States mlncn Minneapolis, MN, USA

    The patch is straightforward and very needed.

    Marking as major because it can cause a fatal error when you try to go to the manage display form of a content type (for example /admin/structure/types/manage/article/form-display). And there is no easy way to figure out that maxlength is to blame without a debugger (or searching the web now that i'm dumping the entire error message here):

    The website encountered an unexpected error. Try again later.

    TypeError: Unsupported operand types: array + null in Drupal\field_ui\Form\EntityFormDisplayEditForm->{closure:Drupal\field_ui\Form\EntityFormDisplayEditForm::thirdPartySettingsForm():129}() (line 131 of core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php).

    And the stacktrace:

    Drupal\Core\Extension\ModuleHandler->invokeAllWith() (Line: 127)
    Drupal\field_ui\Form\EntityFormDisplayEditForm->thirdPartySettingsForm() (Line: 459)
    Drupal\field_ui\Form\EntityDisplayFormBase->buildFieldRow() (Line: 40)
    Drupal\field_ui\Form\EntityFormDisplayEditForm->buildFieldRow() (Line: 213)
    Drupal\field_ui\Form\EntityDisplayFormBase->form() (Line: 107)
    Drupal\Core\Entity\EntityForm->buildForm()
    call_user_func_array() (Line: 528)
    Drupal\Core\Form\FormBuilder->retrieveForm() (Line: 279)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::wrapControllerExecutionInRenderContext():121}() (Line: 622)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->{closure:Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber::onController():96}() (Line: 183)
    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)
    
  • 🇧🇪Belgium joevagyok

    Thank you for the report and the fix!

    • cd41119b committed on 3.x
      Issue#3530218: Function maxlength_field_widget_third_party_settings_form...
    • joevagyok committed f156d79a on 2.1.x
      Issue#3530218: Function maxlength_field_widget_third_party_settings_form...
Production build 0.71.5 2024