When an inline entity form is added to a Registrant type, it stops registrations from saving and produces this error:
Error: Call to a member function id() on null in Drupal\recurring_events_registration\Form\RegistrantForm->validateForm() (line 342 of /Users/the_glitch/Sites/My Suite 253/modules/contrib/recurring_events/modules/recurring_events_registration/src/Form/RegistrantForm.php)

Comments

the_glitch created an issue. See original summary.

owenbush’s picture

I have confirmed this. I believe this is because IEF actually validates the parent form when it is submitted, and the parent form in this case does some special stuff that IEF doesn't and so its throwing the error.

I'll investigate and figure out a fix.

owenbush’s picture

Status: Active » Needs review
StatusFileSize
new3.69 KB

Attached is a patch which reworks some of the registration form work to prevent this issue from happening when elements in the form submit the form via AJAX. This would be an issue with IEF, but also potentially things like paragraphs or other AJAXified form elements.

  • owenbush committed ac08bac on 8.x-1.x
    Issue #3145454 by owenbush, the_glitch: Inline Entity Form stops...

  • owenbush committed 73a4c93 on 2.0.x
    Issue #3145454 by owenbush, the_glitch: Inline Entity Form stops...
owenbush’s picture

Status: Needs review » Fixed

OP confirmed through Slack that the patch worked. So this has been merged and marked as fixed.

the_glitch’s picture

Sorry. Yes the patch works.

Status: Fixed » Closed (fixed)

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