3

On Drupal 7, you can add fields that have been added to nodes to user accounts. At admin/config/people/accounts/fields, scroll down to Add related fields and simply select the field, easy.

But in Drupal 8, at /admin/config/people/accounts/fields, I see no option to add an existing field, just Add Field, which adds a new field.

Has this option been removed from Drupal 8, and if so, why?

1 Answer 1

8

Yes this option has been removed, a field cannot be shared across entity types.

You can, however, add the same field again, I.e. use the same name. Whilst they will share a name, they will be separate fields.

The reason for this is storage. In drupal 7, field storage was separate to entity storage, which meant a mismatch. In drupal 8, entity storage also handles field storage. This means if for example mongodb wants to store an entity and it's fields as a single blob/document - it can. On drupal 7 this would have required two blobs, one for the entity and one for the fields.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.