Inline Entity Form: Optional #save_form as field config option?

Created on 9 January 2020, almost 5 years ago
Updated 15 March 2023, almost 2 years ago

I see that Inline Entity Form supports an optional #save_entity to indicate that inline/child form should save changes even without saving the parent form. (ie. User clicks Update on inline form, and inline form changes are saved to db even if the embedding form is never saved). It would be helpful to see this exposed as an option in field instance configuration.

✨ Feature request
Status

Postponed: needs info

Version

1.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States texas-bronius

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States patpluspun

    My apologies @geek-merlin I wasn't aware you had replied to me. We have editors at work that ofen work on rather large slideshows, and we use IEF to produce minimal forms so they don't have the entire entity to deal with inline. Sometimes (more often than I'm used to) they have browser crashes, and if they don't manually hit the save button every so often they can lose a lot of work, so #save_entity helps in that it auto saves as they complete each section. If their browser crashes, they only lose the one asset they were working on rather than possibly all of them.

    Hope that clarifies!

  • πŸ‡©πŸ‡ͺGermany geek-merlin Freiburg, Germany

    @patpluspun Thanks for clarifying.
    I can see the point, and we have the same with all kinds of edit actions.
    But the solution feels like a dirty hack. I don't expect the entity to be saved before i hit save.

    I see at least 2 viable solutions:
    - Add the option to save intermediate results as forward revision on the server.
    This can benefit all forms. Maybe there's already a module for it?

    - Add the option to save intermediate form state in the browser's local storage.
    This can benefit all forms. Maybe there's already a module for it?
    (At least there are browser extensions, iirc one is called lazarus.)

  • πŸ‡¨πŸ‡¦Canada Nathan Tsai

    Here's another use case.

    We're using IEF to allow HR managers to create usuable, onboarding forms (e.g. Media entities) inline.

    Even if they do not save the onboarding package, we want this reusable form to still exist (as it exists in our eSignature vendor's database).

    Thank you for vetting feature requests and your hard work on this piece of art :)

  • πŸ‡¨πŸ‡¦Canada Nathan Tsai

    Patch for the 2.0.x branch.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    8 pass, 8 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update over 1 year ago
    8 pass, 9 fail
  • Status changed to Active 10 months ago
  • πŸ‡¨πŸ‡¦Canada Nathan Tsai

    Making this back to active due to provided use case.

  • πŸ‡¨πŸ‡¦Canada Nathan Tsai

    New patch for 3.x

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.2.x + Environment: PHP 8.1 & MySQL 5.7
    last update 10 months ago
    29 pass
  • I think this is useful feature for whenever you need access to the inline entity before saving the parent entity. This is the case whenever the parent entity has some dependent value on the inline entity aside from the relationship to the inline entity.

    Additionally, providing this option moves more towards a decoupled approached of performing one atomic operation.

Production build 0.71.5 2024