TypeError: 'WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in WidgetBase.php'

Created on 4 July 2024, 10 months ago

Problem/Motivation

This error appears in version 1.8+dev, after fixing errors in 1.8 version.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇳🇱Netherlands johnv

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

Comments & Activities

  • Issue created by @johnv
  • Assigned to sarwan_verma
  • Issue was unassigned.
  • 🇮🇳India ayush.pandey

    Not able to reproduce this issue any longer. Thus, can be closed.

  • 🇫🇷France dcoppel

    I still have this issue even with the dev version of workflow module. If it can help I use a node form including a IEF field referencing an other type node.
    This error appears when I click from the original form to had a referencing IEF field and when the form of referencing IEF field appears in my original form I press IEF field cancel button to close it but errors appears and the IEF field form doesn't close.

    There is other warning link to this error if it can help :

    Undefined array key "original_deltas" in Drupal\Core\Field\WidgetBase->flagErrors() (...web/core/lib/Drupal/Core/Field/WidgetBase.php ligne 576)
    Trying to access array offset on value of type null in Drupal\Core\Field\WidgetBase->flagErrors() (...web/core/lib/Drupal/Core/Field/WidgetBase.php ligne 576)
    Undefined array key "" in Drupal\Core\Field\WidgetBase->flagErrors() (...web/core/lib/Drupal/Core/Field/WidgetBase.php ligne 577)

    There is no issue with version 1.7 of workflow module.
    Thanks for your help to resolve this issue.
    Regards

  • 🇫🇷France dcoppel

    It seems that IEF with workflow is not the problem since I used dev version of v.1.8.
    First when I upgraded from v.1.7 to dev version of v.1.8, Some fields like language, to state, timestamp and log message was activated in the manage form display menu of my workflow. So I desactivated them as I don't want to display them in my node form.
    In my case I used actions button in my node form to change state to an other state status field of my node base on a workflow.
    Node creation works perfectly when I use an administrator right. But when I try with a basic right, node creation crashes with the error message :
    TypeError : Drupal\Core\Field\WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in web/core/lib/Drupal/Core/Field/WidgetBase.php on line 580
    Why did it work with an administrator right and crash with a basic right ?
    With v.1.7 It works fine. Could you help me resolve this issue as I can't upgrade my all core drupal since this issue...
    Regards,

  • 🇫🇷France dcoppel

    With the latest dev version (9197af8754), this error still exist. Thanks for your help.

  • 🇳🇱Netherlands johnv

    Please download latest dev. There must be no errors in Workflow now. A lot has been done in the last 2 weeks.

  • 🇳🇱Netherlands johnv

    This should be fixed. Please reopen if not.

  • 🇫🇷France dcoppel

    Just to inform that with the last dev version, there is still this error :TypeError : Drupal\Core\Field\WidgetBase::errorElement(): Argument #1 ($element) must be of type array, null given, called in web/core/lib/Drupal/Core/Field/WidgetBase.php on line 580 in Drupal\Core\Field\WidgetBase->errorElement() (line 646 of web/core/lib/Drupal/Core/Field/WidgetBase.php

Production build 0.71.5 2024