Hello,

I'm opening a new issue as I didn't seem to be able to reopen the other issue…

https://www.drupal.org/project/inline_entity_form/issues/2830328#comment...

I just updated from rc1 to rc2 and our inline_entity_form for existing entities started not working. Reverting back to rc1 got everything working again.

In rc2 when trying to select an existing image I would get the following error…

Notice: Undefined index: entity_id in Drupal\inline_entity_form\Plugin\Field\FieldWidget\InlineEntityFormComplex->extractFormValues() (line 621 of /modules/contrib/inline_entity_form/src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php).

Please let me know if you need more information.

Thanks,

•• matt

Comments

mattlt created an issue. See original summary.

mattlt’s picture

Issue summary: View changes
mariacha1’s picture

Status: Active » Needs review
StatusFileSize
new879 bytes

Here's a little patch that wraps around the warning you get if there is no set `entity_id` in the internal form.

geek-merlin’s picture

Status: Needs review » Postponed (maintainer needs more info)

Thanks @MattIt for raising this.

> I just updated from rc1 to rc2 and our inline_entity_form for existing entities started not working.

"started not working" is not helpful though. Is there any other problem apart from the warning? Please learn about writing good issue summaries! Also check if your problem persists with current dev and change the version to dev. Thanks!

FTR: In the related issue, a missing codepath for existing entities was added in the complex widget.

mariacha1’s picture

Title: Required IEF forms for existing entities stopped working after rc2 » `Notice: Undefined index: entity_id` keeps entity browser from passing value back to IEF if php configured to show errors
Version: 8.x-1.0-rc2 » 8.x-1.x-dev
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new5.57 MB

I'm updating the issue version and the description, because I can confirm it's still a problem in the dev branch.

If you have PHP set to show all errors and warnings, the notice thrown Undefined index: entity_id in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php on line 621 shows up above the ajax response, and that keeps the "Browse" button from connecting with the IEF form. To the user, the form appears to refresh without connecting to the selected block.

Here's a little video:
When a content editor adds a block using entity browser, the ajax returned begins with an undefined index warning

I am using Drupal 8.8.1 if that helps.

geek-merlin’s picture

Status: Needs review » Postponed (maintainer needs more info)

@mariacha1:

Thanks for updating this, this is totally well described!
(Next time please put your text in the issue summary, which helps a lot if the issue gets long, but i don't see that problem here, hopefully.)

> If you have PHP set to show all errors and warnings, the notice thrown Undefined index: entity_id in src/Plugin/Field/FieldWidget/InlineEntityFormComplex.php on line 621 shows up above the ajax response, and that keeps the "Browse" button from connecting with the IEF form. To the user, the form appears to refresh without connecting to the selected block.

So if you suppress errors and warnings via admin/config/development/logging, everything works as expected?
Does the patch above fix the problem for you?

mariacha1’s picture

Oh, thanks for letting me know! I never know how sacred the initial description is :).

Yes, that patch fixes the issue for me (as does turning error reporting off in php).

geek-merlin’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

> how sacred the initial description is :).

Often it ends up at the bottom with heading "Original description".

> Yes, that patch fixes the issue for me (as does turning error reporting off in php).

OK, code makes sense, as maintainer setting RTBC for this and will commit later.

  • geek-merlin committed feebdf0 on 8.x-1.x
    Issue #3093298 by mariacha1, geek-merlin, mattlt: `Notice: Undefined...
geek-merlin’s picture

Status: Reviewed & tested by the community » Fixed

Comitted, thanks!

Status: Fixed » Closed (fixed)

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