To be quite honest, I'm not sure if this is a bug or a feature request so we'll mark it bug for now and if someone knows more, we can move it. :)

Effectively when selecting a Content Type for export which also contains Fields, you cannot deselect a field from the UI. So for example, if I have Page selected which contains field_foo, field_bar, and field_baz and want to exclude field_baz, there is no way to do so through the UI.

Seems in this code:

      $fields = field_info_instances('node', $type);
      foreach ($fields as $name => $field) {
        $pipe['field'][] = "node-{$field['bundle']}-{$field['field_name']}";
      }

It goes through and adds the fields. Which would be fine if we had a way to deselect them from the "Component: Fields:field" category. However, when you browse there the fields are already deselected. Selecting them and then deselecting only changes the "Auto Detected" property of the field.

Question is, how would one go about exporting a large content type with all of its fields except a few?

Looks like function hook_field_default_fields_alter(&$fields) {} has promise but it feels awkward having to define a feature and then write a custom module for all other sites which will use it.

Business case is basically the original site defined a field that was specific to it. Everything else is viable for export and reuse except the one. Also, Ezra mentioned in IRC that he can see another case being "it's something distro devs rely on to export just the relevant bits from their sites that are re-usable"

Anyway, wanted to start the discussion. I'm happy to provide a patch if we can zero in on where/why it's occurring and if we think it's best to update it.

Thank you.

Comments

webkenny’s picture

Category: bug » feature

Thinking this might actually be a feature request based on an IRC chat with hefoxed. Looks to be the narrow implementation of #1400298: Removing auto-detected components from a feature (UI update, removing Ajax) which handles this more broadly.

Will mark as duplicate.

webkenny’s picture

Status: Active » Closed (duplicate)