Save newly created entities immediately

Created on 6 March 2024, 9 months ago

Problem/Motivation

A very common usability issue exists in Drupal if you use Paragraphs, ECK, IEF (i.e., for creating Product Variations on Commerce Product entities) regarding new taxonomy terms and perhaps less common, other referenced entities.

For example, let's say a "recipe" node holds a multi-value reference field to ECK entities called "step" that are created on the fly. These entities hold a field called: Ingredient (taxonomy), quantity (decimal), and unit (list). The "Ingredient" field allows new terms to be created.

Let's say we add a recipe with 4 steps, both the first step and the last step involve the ingredient "sugar" because we're going to sprinkle some on top. Let's say "sugar" is a new term, and we enter it as we add the first "step" ECK entity. We select "add another" and work down the list. At the final "step" entity, we again enter "sugar" as the ingredient.

Now, the term "sugar" still doesn't exist, even though we entered it in step 1 because the "Step" entities won't get saved before we save the parent "Recipe" node. Only after we save the recipe node, will the term be created. That of course means that we'll end up with two "sugar" terms, as the last referenced entity will trigger the same process of saving "sugar" as a new term with the same name.

This behavior is infinitely confusing for content creators and end-users, and it results not only in duplicate terms but all sorts of interface distortions (if we render the ingredients for the recipe, "sugar" will be listed twice with different quantities in, for instance, the "What you'll need" section (assuming the node has one).

I have so far not found an existing solution to this problem which I'm sure is not rare, considering the popularity of IEF, commerce, etc. I'm also sure the solution is probably not easy but likely much desired.

Thanks in advance for any insights into this.

Steps to reproduce

Proposed resolution

Introduce a setting in the IEF configuration to "save newly created entities immediately".

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Active

Version

3.0

Component

Code

Created by

🇹🇭Thailand AlfTheCat

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

Comments & Activities

Production build 0.71.5 2024