2

I have two Drupal sites.

On Site1, I created 4 custom text fields for the User Profile. I created a Feature that included these fields. I didn't see an area where I could export the settings for Custom User fields, so I searched for their respective machine names and added them.

enter image description here

On site #2, I added the feature and the fields now appear to be imported.

enter image description here

Despite this, when going to Configuration > People > Account settings, going to "Add existing field" does not list the newly imported fields to that list. They also are not available as "Existing Fields" when modifying a Content Type.

enter image description here

On top of that, when attempting to create a field with the same machine name, it states that it is already taken.

enter image description here

It seems the Features has indeed imported the desired fields but they are for some reason inaccessible.

How can this be fixed?

  • You forget to export the field instances. Field instances is the instance of field base which attached to the entity type and bundle. – Jimmy Ko Aug 12 '16 at 0:48
2

Solution

You have to add the corresponding field instances in feature as well. The field instance name should be in this format:

[entity_type]-[bundle]-[field_name]

In your case, they should be:

  • user-user-field_first_name
  • user-user-field_last_name
  • user-user-field_title
  • user-user-field_email

Sub Question 1

Despite this, when going to Configuration > People > Account settings, going to "Add existing field" does not list the newly imported fields to that list. They also are not available as "Existing Fields" when modifying a Content Type.

Answer

You cannot find existing fields because there is no field instance attached on the field base. Drupal won't be able to load those field base without field instance.


Sub Question 2

On top of that, when attempting to create a field with the same machine name, it states that it is already taken.

Answer

The field base is stored in database and also the table is created. So Drupal will stop you from recreation.

  • Great answer! +1 and marked as solution. Thank you for your clear and concise explanation! I learned something new about Features today. – AndrewMRiv Aug 12 '16 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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