"Undefined index: override" and "Undefined index: target_id" when saving field configuration

Created on 25 June 2020, about 5 years ago
Updated 15 January 2025, 6 months ago

When creating or editing an ER Override field on Drupal 8.9.1 on PHP 7.2.31, several PHP notices appear.

The following message is repeated twice:

Notice: Undefined index: override in entity_reference_override_validate_custom_text() (line 58 of modules/contrib/entity_reference_override/entity_reference_override.module).

The following message is repeated four times:

Notice: Undefined index: target_id in Drupal\Core\Field\Plugin\Field\FieldWidget\EntityReferenceAutocompleteWidget->massageFormValues() (line 144 of core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EntityReferenceAutocompleteWidget.php).

πŸ› Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States GuyPaddock

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.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Cannot reproduce in Drupal 10 / PHP 8 (which is the minimum now β†’ )

  • Status changed to Active about 1 month ago
  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    Reported by a colleague on Drupal 11:

    Warning: Undefined array key "override" in entity_reference_override_validate_custom_text() (line 59 of modules/contrib/entity_reference_override/entity_reference_override.module).

    entity_reference_override_validate_custom_text()
    call_user_func_array() (Line: 281)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 238)
    Drupal\Core\Form\FormValidator->doValidateForm() (Line: 118)
    Drupal\Core\Form\FormValidator->validateForm() (Line: 585)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
    Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (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: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 124)
    Drupal\cloudflare\CloudFlareMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

    With a follow-up note:

    Looks like it doesn't throw the error only if 'single line no markup' is used as the custom text format!?

Production build 0.71.5 2024