Using inline entity form with contacts module profiles
inline entity form user reference user name inline entity form profile reference drupal 8 how to use profile forms
Add integration for the user entity type https://www.drupal.org/project/inline_entity_form/issues/2702401
There is no doubt that profile fields reference the user profile entity, not the user entity.
MariaDB [db]> select * from user__profile_crm_indiv;
+--------+---------+-----------+-------------+----------+-------+-----------------------------+
| bundle | deleted | entity_id | revision_id | langcode | delta | profile_crm_indiv_target_id |
+--------+---------+-----------+-------------+----------+-------+-----------------------------+
| user | 0 | 2 | 2 | en | 0 | 1 |
+--------+---------+-----------+-------------+----------+-------+-----------------------------+
1 row in set (0.00 sec)
MariaDB [db]> select * from profile__crm_name;
+-----------+---------+-----------+-------------+----------+-------+----------------+----------------+-----------------+-----------------+-----------------------+----------------------+
| bundle | deleted | entity_id | revision_id | langcode | delta | crm_name_title | crm_name_given | crm_name_middle | crm_name_family | crm_name_generational | crm_name_credentials |
+-----------+---------+-----------+-------------+----------+-------+----------------+----------------+-----------------+-----------------+-----------------------+----------------------+
| crm_indiv | 0 | 1 | 1 | und | 0 | NULL | Sam | NULL | Gibbons | NULL | NULL |
+-----------+---------+-----------+-------------+----------+-------+----------------+----------------+-----------------+-----------------+-----------------------+----------------------+
1 row in set (0.00 sec)
MariaDB [db]> select * from users_field_data;
+-----+----------+--------------------+--------------------------+-------+---------------------------------------------------------+-------------------+----------+--------+------------+------------+------------+------------+-------------------+------------------+
| uid | langcode | preferred_langcode | preferred_admin_langcode | name | pass | mail | timezone | status | created | changed | access | login | init | default_langcode |
+-----+----------+--------------------+--------------------------+-------+---------------------------------------------------------+-------------------+----------+--------+------------+------------+------------+------------+-------------------+------------------+
| 0 | en | en | NULL | | NULL | NULL | | 0 | 1566394537 | 1566394537 | 0 | 0 | NULL | 1 |
| 1 | en | en | NULL | admin | $S$EOe.pB5VNqohTxDLI4jhIcmgAZajuEohAUj7lPouZZIqT.OBExlh | admin@example.com | UTC | 1 | 1566394537 | 1566394537 | 1566400349 | 1566395775 | admin@example.com | 1 |
| 2 | en | en | NULL | NULL | NULL | sg@sg.sg | UTC | 0 | 1566396737 | 1566396737 | 0 | 0 | NULL | 1 |
+-----+----------+--------------------+--------------------------+-------+---------------------------------------------------------+-------------------+----------+--------+------------+------------+------------+------------+-------------------+------------------+
Fresh site with just the contrib profile
module enabled and a profile created with the machine name test
:
- At the address
/user/1556/test/add
we have the formprofile_test_add_form
(with the title “Add new profile”). - At the address
user/1556/test
(the only path that works with Contacts enabled, as far as i can tell; theadd
path gets access denied on that other site) we also have the formprofile_test_add_form
. So that’s good.
On the site with contacts module, going to the same sort of path
(user/5/crm_org
for instance) gets the same kind of form
(profile_crm_org_add_form
) with the title “Create Organisation”; and almost the same for individual, but /user/5/crm_indiv
was created on the user account page and gets profile_crm_indiv_edit_form
. It still says “Create Individual” though until
When adding an initial Individual contact (just name and e-mail), Contacts uses ``
``
When editing an Individual contact, Contacts uses this:
profile_crm_indiv_contacts_dashboard_form
Above from the Summary tab. This latter is the same (profile_crm_indiv_contacts_dashboard_form
) on the Individual tab (path admin/contacts/6/indiv
for example).
inline_entity_form
’s src/Element/InlineEntityForm.php
is the form that contains the form for the entity being added– not the form that adds the buttons to add new or reference existing entities. (My issue is that profiles does not have an add new button, for the very