Function maxlength_field_widget_third_party_settings_form() should return array.

Please check function hook_field_widget_third_party_settings_form() definition.

Issue fork maxlength-3530218

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

super_romeo created an issue. See original summary.

divyansh.gupta’s picture

Assigned: Unassigned » divyansh.gupta

Working on it!!

divyansh.gupta’s picture

Assigned: divyansh.gupta » Unassigned
Status: Active » Needs review

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

super_romeo’s picture

Status: Needs review » Reviewed & tested by the community

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

mlncn’s picture

Priority: Normal » Major

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)
joevagyok’s picture

Assigned: Unassigned » joevagyok
joevagyok’s picture

Status: Reviewed & tested by the community » Fixed

Thank you for the report and the fix!

joevagyok’s picture

  • 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...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.