i met chris chris

So Much Mandated Technology

"So much mandated technology…they [generally large companies] just take the [provider] with the most steaks and the most strippers; typically from companies who have expense accounts and sales people who can sell them very expensive application servers over six months." http://twit.tv/floss79

Drupal - Features Module - Moving a CCK (Content Type) From One Feature to Another

3086495495_ab338eecc4.jpg Recently ran into an interesting problem - I wanted to move a content type (cck) that I had created from one feature to another (specifically to move it into a spaces enabled feature to gain some of those benefits - thanks devseed!); however, as you might be aware (if you are stumbling across this) features is pretty smart - often *too* smart. When removing the content type from one feature it will effectively remove the content type from your drupal install; whilst if you add the content type to another feature in parallel features will ingeniously mark the other feature you have as a dependency. What we are going to exploit: drupal features caches with a version control system (VCS - I prefer git) and drush:

vernacular:
* laterBranchOrTag - the later time we are trying to get to in our source
* earlierBranchOrTag - the time when our feature we are coming *from* was correct
* featureNameOld = old feature (to delete from)
* featureNameNew = new feature (to be added to)

What we have done - we have basically loaded many of drupal’s caches (note: some items like variables, with strongarm, do not use the db for cacheing - this is a different animal) with the feature and CCK defs and then switched the code base beneath it. When the features-update occurs the items that are cached are written out into features code, but in the featureNameNew namespace.

simple enough?