Saving field settings cuases errors and warnings

Created on 28 September 2022, almost 2 years ago
Updated 29 January 2024, 5 months ago

Problem/Motivation


    Warning: Trying to access array offset on value of type null in unique_field_ajax_validate_unique() (line 572 of modules/contrib/unique_field_ajax/unique_field_ajax.module).

    unique_field_ajax_validate_unique(Array, Object, Array)
    call_user_func_array('unique_field_ajax_validate_unique', Array) (Line: 282)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'field_config_edit_form') (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm('field_config_edit_form', Array, Object) (Line: 588)
    Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 320)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    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: 159)
    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: 709)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Warning: Trying to access array offset on value of type null in unique_field_ajax_validate_unique() (line 572 of modules/contrib/unique_field_ajax/unique_field_ajax.module).

    unique_field_ajax_validate_unique(Array, Object, Array)
    call_user_func_array('unique_field_ajax_validate_unique', Array) (Line: 282)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'field_config_edit_form') (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm('field_config_edit_form', Array, Object) (Line: 588)
    Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 320)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    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: 159)
    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: 709)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

    Deprecated function: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in Drupal\Core\Config\Entity\Query\Condition->compile() (line 39 of core/lib/Drupal/Core/Config/Entity/Query/Condition.php).

    Drupal\Core\Config\Entity\Query\Condition->compile(Array) (Line: 85)
    Drupal\Core\Config\Entity\Query\Query->execute() (Line: 652)
    unique_field_ajax_is_unique('field_config', '0', 'field_company_kurzel', NULL, 'field_config', , NULL, Object) (Line: 572)
    unique_field_ajax_validate_unique(Array, Object, Array)
    call_user_func_array('unique_field_ajax_validate_unique', Array) (Line: 282)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'field_config_edit_form') (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm('field_config_edit_form', Array, Object) (Line: 588)
    Drupal\Core\Form\FormBuilder->processForm('field_config_edit_form', Array, Object) (Line: 320)
    Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
    Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 564)
    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: 159)
    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: 709)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)



Steps to reproduce

D.9.4.6 on php 8.1
Field is set to unique.
Field is on a taxonomy term (may be relevant - see case https://www.drupal.org/project/unique_field_ajax/issues/2953040 )

Enable or disable ajax and save.
Just save without changing anithing.
In any of the 2 cases you get the following errors.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇦🇹Austria maxilein

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024