admin's blog

The development road not taken

I am a Drupal developer. Or more specifically, I am a Drupal 7 developer *today* because my main client is on a D7 distro that isn't switching to D8 in the next two years. There simply is no budget.

I'm not sure what I will be tomorrow, or next month, or next year. I think I will bill myself as a Web Developer once again since I find myself building and iterating features on sites on a variety of publishing tools.

Reverting Features and hook_post_features_revert() versus hook_update()

I'm working with a distro and I've been looking for a permanent solution to an issue I have with removing fields defined by the distro which the client does not need. I have used hook_update in the past like this. 

/**
* Remove unused fields from distro
*/
function mymodule_update_7101() {
if ($instance = field_info_instance('node', 'field_topics', 'blog')) {
field_delete_instance($instance, TRUE);
field_purge_batch(1);
}
...
}