Problem/Motivation

If it is known which entity needs to be edited, right now, we need to go through the list to find that entity and click on its edit button which is time consuming.

Proposed resolution

Adding the ability to reference an entity and auto open its edit form will speed the editing process.

Remaining tasks

  1. The patch needs to be created
  2. The patch needs to be reviewed
  3. The patch needs to be tested

Comments

designesse created an issue. See original summary.

bojanz’s picture

Sorry for the delay in responding to this, we've been busy refactoring and cleaning up the codebase.

If I understood correctly, you want the ability to specify a reference in the URL of the add form (node/add/page?article=12), have IEF pick up that value, and auto open the edit form?

benjy’s picture

I was able to make the first part of this work with a defaultValueCallback on the parent ER field that looks like this:

  public static function prefillDefaultTeamMember() {
    $list_values[] = [
      'entity' => OrganisationTeamMember::create([
        'full_name' => 'User no1',
      ]),
    ];

    return $list_values;
  }

However, I wasn't able to make IEF default to open the form with the default values.

kenton.r’s picture

This is what I am needing to do as well. Prepopulate is working on a being able to preselect the reference #3029328. But how would you have it auto open the edit form?

ghost of drupal past’s picture

Status: Active » Needs review
StatusFileSize
new1.71 KB

I have added a simple helper method which allows /node/90010/edit?ief_open[]=paragraph:616562&ief_open[]=paragraph:616558 style URLs to work. I immediately use it in this patch but I also have an InlineParagraphsWidget patch which changes if ($default_edit_mode == 'open') { to if (InlineEntityFormBase::entityIsOpenFromQuery($paragraphs_entity, $form_state) || $default_edit_mode == 'open') { and now the children of those widgets open too.

I believe this is the same as inline_entity_form_open_row_form setting edit and so subsequent button presses will behave correctly / same.

ghost of drupal past’s picture

StatusFileSize
new2.51 KB

One more thing: let's make it possible to scroll to the opened form.

ghost of drupal past’s picture

StatusFileSize
new2.48 KB

Reroll.

podarok’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Needs review » Fixed

tnx

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

geek-merlin’s picture

Version: 2.0.x-dev » 3.x-dev
Status: Closed (fixed) » Needs work
Related issues: +#3401656: Clean up problematic 2.x branch

Bulk reopen.

geek-merlin’s picture

Issue tags: +Needs tests

Review: I like this a lot. Needs a test though.