Debugging drush updb
If you’ve ever tried to debug your update hooks via drush you may (like me) have been puzzled as to why your breakpoints don’t seem to work.
Technical information on this site may be out of date : no updates since 2015
If you’ve ever tried to debug your update hooks via drush you may (like me) have been puzzled as to why your breakpoints don’t seem to work.
Drupal update hooks can return info about queries run - and this is well documented.
If you want to return other informative messages about updates - just use the same format as returned by http://api.drupal.org/api/function/update_sql/6
<?php
array('success' => $result !== FALSE, 'query' => check_plain($sql));
?>
So you might have an update hook that looks like.
In order to make releases repeatable, to be able to test updates and share work will colleagues it is really useful to install new modules (and disable old ones) in update hooks.
This way one just has to update the code, then run update.php and you have the latest version of the site.
To make a Drupal module that provides triggers you need to
I need a user hook that sends password reset events.
I created a very simple module to do this - but it doesn’t work.
I’ve long been puzzled by the official advice on upgrading Drupal
It basically says you should delete everything, unpack a new Drupal version, and replace your customisations.
I like to use version control to manage my site.
Here’s a basic Drupal Module that pulls CKAN data into Drupal.
It provides a simple search interface - when the user views a CKAN package for the first time a corresponding node is created.
I’ve been working on a couple of open data projects recently - which has been very rewarding.
A couple of people have asked for some code so I’ve knocked up a quick version of the sort of thing I’ve been working on.
This code requires PHP 5.1 for the JSON functions but doesn’t need any extra libraries (pecl_http can give better error messages but is a bit of a pain to install).
The Notes field in packages returns output in Markdown format - you can convert this to HTMl with a parser available at http://michelf.com/projects/php-markdown
This isn’t production code so please test before using.
I was just reading this presentation on deploying Drupal
http://www.slideshare.net/eaton/drupal-deployment-presentation
and noticed
Drupal has a couple of modules which allow you to produce your own tinyurl.com type website - complete with your own tracking etc.
This has been extended for use by the US government at http://go.usa.com/ and the code re-released to the community.