Drupal Planet

D7: Export and Import Rules with Hook Update Deploy Tools

In Drupal 7, Features is one option for deploying Rules and changes to them.  Now there is another alternative.  As of version 7.x-1.10 of Hook Update Deploy Tools, the module adds the ability to use Drush to export an existing rule from a development server, commit it to version control, then deploy it to a production server using hook_update_N().

Of course being a method from HookUpdateDeployTools, it brings with it the standards of the module:

hook_geocoder_geocode_values_alter()

If you are using the geocoder module in Drupal 7 and you need the opportunity to alter the data being geocoded right before it gets sent to whichever geocoding service you are using, there is a hook for that. The hook is pretty much undocumented at this time, but it is there. hook_geocoder_geocode_values_alter() is available for you if you need it.

Moving Views Exposed Filters Form Elements Around

In Drupal 7, Views allows you to easily create exposed filters and alter a lot of the logic involved.  However, sometimes you get requests to add text to the form or position things in ways that the Views UI does not allow for.

I've got two solutions that are arguably not as Drupal-like as I would like, but I've run into some dead ends on occasion with trying to fullfill requests with only Drupal-like alterations.  And of course if there are better ways to do it, I am open to them.

Hook Update Deploy Tools: to delete fields

If you have used a Feature and removed a field from the Feature and reverted, only to find the field still present in your content type, this update is for you. Hook Update Deploy Tools now has a method (as of version 7.x-1.6) to remove a field instance from the content type. The method gives feedback as to the removal of the field, checks to see that it was removed, and reports whether it was the only instance of the field or not.

Deploy Drupal variable changes with Hook Update Deploy Tools

If you are already using hook_update_N() in your custom deploy module or within a Feature to make related database changes across your development and production environments, it is an easy step to just use variable_set() to make settings changes without locking them into a Feature with strongarm.  The problem is, variable_set() runs silent.

Deploy Feature changes by reverting with Hook Update Deploy Tools

If you are using a deploy workflow with your Drupal website you may be reverting your Features through code.  One approach is to make the Feature take care of itself by adding an .install file to the Feature and then adding a hook_update_N() to the install.  This has some nice advantages of keeping your changes compartmentalized.  Translation: fewer merge conflicts on your custom_deploy.install.

Module Release: Hook Update Deploy Tools

After working on several sites that were using hook_update_N() in install files to handle continuous site deployment by enabling modules, reverting features, updating menus and setting variables, we (CivicActions) built a handful of methods to more safely support that and issue better feedback when running `drush updb` or using update.php. 

Drush sql-query output

Despite several tries, I have never had any luck using the native sql output formatting commands to work with drush

Manage Drupal Feature Updates

When using Features module to move changes from one  development environment to the next, it can be tricky to track which Feature ought to be 'reverted' in order make the new code be incontrol.  Sure you can revert them all in one shot with `drush features-revert-all`, but that is pretty intensive to do especially on a production site and can lead to some race conditions.

Pages

Subscribe to RSS - Drupal Planet