7

While exporting configuration for my site using the Features module, I noticed that one of the fields I use on many content types was initially created on the "news" content type instead of the "article" content type. This presents a problem, since it means all of the features that I export are now dependent on a completely unrelated module (news) to provide a common field (field_image).

What I'd like to do is change the entity that "owns" field_image to be article. This will let me export one base feature which provides a bunch of common fields, and have the rest of the features depend on that instead of having them all depend on news.

How can I change which content type owns field_image without breaking everything?

1

Features is smart enough to require the module that implements the field, without requiring a bundle that you haven't told it to require. So you might consider double-checking the feature you've created to make sure you haven't included the content type you don't want.

1

Well, this isn't the perfect solution, but may be a way to find it.

Change your content type to what you want to have it and export the feature. Them take a difftool (winmerge) and look at the diffrences between the old version of your features module and the new one.

There's a good chance that you find out what to change.

Don't forget to take a DB Backup before you start.

1

I think you just have to change the bundle type of the field. Maybe your feature has the field belonging to the "news" bundle. If you change it to "article" it will be done.

Open the feature.field.inc and search for "bundle" then change the value for the correct one. Notice that the array index will be the field name so be careful to not change the wrong field.

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.