Add integration for the user entity type

Created on 8 April 2016, almost 9 years ago
Updated 19 September 2023, over 1 year ago

Hello

I like your module, thank you.

But I have a problem with user entity. I have created field with widget "Inline entity form". This field is referenced to user.
I want to create new user, which will be referenced through this field. But in the inline form I see only fields which are added through field API. For example first name and last name. But there are no system fields like name, mail, password. Due the fact that I can't fill these fields, user cannot be created.
Is it bug? How can I create user through inline entity form?

Thanks in advance.

Feature request
Status

Needs work

Version

1.0

Component

Code

Created by

🇷🇺Russia eugene.ilyin

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.

  • 🇨🇦Canada jigarius Montréal

    While trying the patch in #47, I get the following issues:
    * UserInlineForm should use EntityInterface $entity instead of ContentEntityInterface to be compatible with the parent class.
    * The inline form works in the "default" form mode but it doesn't work with custom form modes that I've created, say "membership". I get the following error:

    Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "user" entity type did not specify a "membership" form class. in Drupal\Core\Entity\EntityTypeManager->getFormObject() (line 207 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).
  • Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    Not currently mergeable.
  • @jigarius opened merge request.
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    PHPLint Failed
  • 🇨🇦Canada jigarius Montréal

    I took a look at the patch 47 and created a PR with some changes. In the end, I got the user creation to work, but for some reason, the newly generated user's ID doesn't get attached to the parent entity's form correctly, i.e. the inline_entity_form elements are not replaced by a nice target_id so the parent form fails to submit.

    In patch 47, the "account" element for the user data don't get copied into the User entity because the AccountForm expects a different structure of values in the FormState. I'm starting to think that it might be better to create a simplified version of the user account form for use with the InlineEntityForm instead of involving AccountForm at all.

    As for my project, I'll be simplifying this by injecting just: name, mail, pass, status, and the Field API fields, if any. At least it will get the ball rolling for me.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 7.3 & MySQL 5.7
    last update over 1 year ago
    PHPLint Failed
Production build 0.71.5 2024