TypeError: key(): Argument #1 ($array) must be of type array, null given in key()

Created on 21 December 2023, 11 months ago

Problem/Motivation

You get the below error if you hit the next button on a user registration form that includes core account fields and is divied into 2 steps.

TypeError: key(): Argument #1 ($array) must be of type array, null given in key() (line 368 of ... /web/core/modules/user/src/AccountForm.php).

The same error message also comes up in another issue from 1.x branch that is linked. The call stack of this one differs from that one.

Steps to reproduce

On a clean installation, add some fields to user. Create a two step registration form with help of this module.

Proposed resolution

A dirty fix attached. Please review or suggest.

Check out the the linked core issue: https://www.drupal.org/project/drupal/issues/3328962 🐛 TypeError: key(): Argument #1 ($array) must be of type array, string given in key() Needs work

Also chceck out the module description of the similar module Entity Form Steps: https://www.drupal.org/node/3281779/revisions/13136701/view

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇹🇷Turkey durum

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

Comments & Activities

  • Issue created by @durum
  • Status changed to Needs review 11 months ago
  • 🇹🇷Turkey durum

    Attached is a quick & dirty fix to keep the functionality of a dev branch of a project.

    I have no idea if it can introduce a security vulnerability, since this is a user registration related process. Please don't use in production until RTBC.

    So please review.

Production build 0.71.5 2024