I'm getting the following error when working in form display using PHP 7.1.27.

Deprecated function: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget::updateFieldWidgetDisplaySettings() should not be called statically en Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse() (línea 69 de /home/admin/web/public_html/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php) #0 /home/admin/web/public_html/core/includes/bootstrap.inc(587): _drupal_error_handler_real(8192, 'call_user_func_...', '/home/admin/web...', 69, Array) #1 [internal function]: _drupal_error_handler(8192, 'call_user_func_...', '/home/admin/web...', 69, Array) #2 /home/admin/web/public_html/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array) #3 /home/admin/web/public_html/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array) #4 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #5 /home/admin/web/public_html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher)) #6 /home/admin/web/public_html/vendor/symfony/http-kernel/HttpKernel.php(227): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent)) #7 /home/admin/web/public_html/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1) #8 /home/admin/web/public_html/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #9 /home/admin/web/public_html/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /home/admin/web/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /home/admin/web/public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 /home/admin/web/public_html/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #13 /home/admin/web/public_html/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /home/admin/web/public_html/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /home/admin/web/public_html/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /home/admin/web/public_html/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #17 {main}.

Any ideas?

CommentFileSizeAuthor
#3 deprecated-non-static-3079366-3.patch942 bytesgun_dose

Comments

7thkey created an issue. See original summary.

gwvoigt’s picture

I'm getting the same AJAX error on PHP 7.2.14.

gun_dose’s picture

Status: Active » Needs review
StatusFileSize
new942 bytes

This patch fixes problem.

criz’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

This is also relevant for 8.x-1.8. It prevents saving the entity display plugin configuration in the form-display.
The patch applies and fixes the issue.

oknate’s picture

Title: Deprecated function: call_user_func_array() expects parameter 1 to be a valid callback, non-static method Drupal\entity_browser\Plugin\Field\FieldWidget\EntityReferenceBrowserWidget::updateFieldWidgetDisplaySettings() » EntityReferenceBrowserWidget::updateFieldWidgetDisplaySettings() should be static

  • oknate committed ac3ad0c on 8.x-2.x authored by gun_dose
    Issue #3079366 by gun_dose, 7thkey: EntityReferenceBrowserWidget::...

  • oknate committed 3606d8d on 8.x-1.x authored by gun_dose
    Issue #3079366 by gun_dose, 7thkey: EntityReferenceBrowserWidget::...
oknate’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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