Having trouble with kind of a weird edge case. I have a feature that provides a node type and fields, as well as some custom code in the .module file. I really want to have the node_type "base" be my module(feature) so I can use hook_save, hook_form, etc. I changed the base manually from node_content to my module name, but when I go to recreate the feature, it doesn't want to export the node type. I've tracked this down to a check in features.node.inc to limit the node_type's owner to either node_content or features. So my feature request is to allow the module(feature) itself to be the owner, as I have done in the following patch.

I know this is an edge case, but it's one I've hit twice now.

CommentFileSizeAuthor
features-export-own-node-type.patch682 bytesrbayliss
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tche082’s picture

i got the same issue. subscribing.

febbraro’s picture

Assigned: Unassigned » febbraro

Seems reasonable

febbraro’s picture

Status: Active » Needs review
alberto56’s picture

Possibly related: The base type of my node type is "uc_product" for use with Ubercart. I changed it by hand in my features.inc file. I'm expecting Features to keep the base of my node type. Instead, Features deletes the entire node type when recreating the feature.

gease’s picture

This patch makes no sense, imho. I faced the same problem, and all you should do is to move implementation of hook_node_info from {name}.features.inc to {name}.module file. It won't be ovewritten by features then. You can edit it and revert the feature.

drzraf’s picture

and what about:
* you have many stuff on website 1 provided by one feature
* you want a subset of this (let's say only on node:type) on website 2
=> you'd need such patch (but AFAICT this one won't apply anymore)

drzraf’s picture

here is something which does not work...

--- a/features.drush.inc
+++ b/features.drush.inc
@@ -245,6 +245,7 @@ function _drush_features_component_filter($all_components, $patterns = array(),
     'not exported' => TRUE,
     'provided by' => FALSE,
   );
+  $options['exported'] = true;
   $pool = array();
   // Maps exported components to feature modules.
   $components_map = features_get_component_map();
Dean Reilly’s picture

@gease I don't think your suggestion would work as features doesn't seem to check what file the hook appears in - it just checks whether it is present or not.