Problem/Motivation

In a node add form with a entity reference field (Inline Entity Form - Complex widget), after a click on "Add new taxonomy term", the AJAX request had this following warning in the response and the request was broken :

Warning: Illegal string offset '_original_delta' in /app/web/core/lib/Drupal/Core/Field/WidgetBase.php on line 372

In the extractFormValues from WidgetBase.php, the _original_delta is added without checking the $value type.

Proposed resolution

Add a type checking is_array on the $value before trying to add a key / value.

Issue fork drupal-2991986

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hait created an issue. See original summary.

xavier.masson’s picture

StatusFileSize
new715 bytes
xavier.masson’s picture

Assigned: xavier.masson » Unassigned
Status: Active » Needs review
alonaoneill’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
vacho’s picture

Version: 8.5.6 » 8.8.x-dev
vacho’s picture

Issue tags: -Needs reroll
StatusFileSize
new715 bytes

Patch rerolled.

yogeshmpawar’s picture

Status: Needs work » Needs review

Setting to Needs Review & Triggering bots.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

xavier.masson’s picture

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

jeffc518’s picture

StatusFileSize
new846 bytes

Rerolled patch for Drupal core 9.3x.

This was done to solve https://www.drupal.org/project/range_slider/issues/3251552.

Note: patch done in PHPStorm with nested web root directory. Would appreciate any heads up on SOP for patch rolling.

cilefen’s picture

Rerolling is a bit involved. But for anything small like this one-liner I would just clone Drupal core apply the changes manually then git diff is the patch. So you can redirect that diff into a file, for example git diff > ~/Downloads/2291986-15.patch.

ranjith_kumar_k_u’s picture

StatusFileSize
new711 bytes
bedlam’s picture

A note to add that this issue apparently affects all entity-reference field widgets that do not include any drag-and-drop capabilities. The following ones are certainly affected by it:

  • Autocomplete (Tags style)
  • Check boxes/radio buttons
  • Select list

I'm not familiar enough with the whole fields subsystem to know if the patch is idea, but it *does* fix all the above cases, and I haven't discovered that it adds any new issue.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

elusivemind’s picture

Patch #16 tested on Drupal 9.4.5 and PHP 8.0 and it resolves the issue I was having saving certain nodes.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs tests

This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.

As a bug this will need a test case.

avpaderno’s picture

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

saidatom made their first commit to this issue’s fork.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.