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.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | 2991986-16.patch | 711 bytes | ranjith_kumar_k_u |
| #14 | 2991986-d9.patch | 846 bytes | jeffc518 |
| #6 | 2991986-6.patch | 715 bytes | vacho |
| #2 | 2991986-2.patch | 715 bytes | xavier.masson |
Issue fork drupal-2991986
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
Comment #2
xavier.massonComment #3
xavier.massonComment #4
alonaoneill commentedComment #5
vacho commentedComment #6
vacho commentedPatch rerolled.
Comment #7
yogeshmpawarSetting to Needs Review & Triggering bots.
Comment #11
xavier.massonComment #14
jeffc518 commentedRerolled 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.
Comment #15
cilefen commentedRerolling is a bit involved. But for anything small like this one-liner I would just clone Drupal core apply the changes manually then
git diffis the patch. So you can redirect that diff into a file, for examplegit diff > ~/Downloads/2291986-15.patch.Comment #16
ranjith_kumar_k_u commentedComment #17
bedlamA 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:
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.
Comment #19
elusivemind commentedPatch #16 tested on Drupal 9.4.5 and PHP 8.0 and it resolves the issue I was having saving certain nodes.
Comment #21
smustgrave commentedThis 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.
Comment #22
avpaderno