PHP exception when saving a registration type and entity_redirect module is enabled

Created on 4 April 2023, over 1 year ago
Updated 6 April 2023, over 1 year ago

Problem/Motivation

When adding a registration type, php throws an exception
Uncaught PHP Exception TypeError: "Cannot access offset of type string on string" at /public_html/core/lib/Drupal/Component/Utility/NestedArray.php line 155

registration type is not created.

Drupal 10.0.7
PHP 8.1.16

Steps to reproduce

install the entity_redirect module β†’
install this module
add or edit registration type

πŸ’¬ Support request
Status

Closed: works as designed

Version

3.0

Component

Registration Core

Created by

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

Comments & Activities

  • Issue created by @badmothergoose
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    Hi thanks for your post. Can you provide more details? What is the name of the registration type and what other modules are installed. Adding a registration type is working for other D10 sites and is passing tests.

  • the error happens whatever the registration type name. After checking with a clean install, the incompatibility is with the module entity_redirect, which otherwise works as expected

    here's the trace, I hope this helps

    TypeError: Cannot access offset of type string on string in Drupal\Component\Utility\NestedArray::setValue() (line 155 of core/lib/Drupal/Component/Utility/NestedArray.php).

    Drupal\Core\Form\FormBuilder->handleInputElement() (Line: 1003)
    Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073)
    Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073)
    Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073)
    Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1073)
    Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 577)
    Drupal\Core\Form\FormBuilder->processForm() (Line: 323)
    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: 580)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 74)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 686)
    Drupal\Core\DrupalKernel->handle() (Line: 19)

  • πŸ‡ΊπŸ‡ΈUnited States john.oltman

    The problem is in the entity_redirect module. It injects itself into other module's forms using a generically named form element named "workflow" that is commonly used in other modules that use the Workflows module in Drupal core. Any bundle entity type that already has a "workflow" element will then fail with a PHP exception. This is also happening with the commerce_order module as noted here:
    https://www.drupal.org/project/entity_redirect/issues/3267587 πŸ› Cannot save commerce order type with entity_redirect enabled Active
    And it will happen with other modules in the future. That module's maintainer needs to use a more unique name such as "entity_redirect_workflow" for that element.

    Please open an issue in that module's issue queue.

  • Status changed to Closed: works as designed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman
  • πŸ‡ΊπŸ‡ΈUnited States john.oltman
Production build 0.71.5 2024