Drupal

weatherfacti module updated for Drupal 6.14

Updated the weatherfacti module to work with Drupal 6.14.  Note that the registration with weather.com is no longer optional.  The source for the module that works with Drupal 6.x should be attached to this post.

The conversion was not quite as simple as expected due to some red herrings. Make sure that if installing for the first time on Ubuntu that you have php5-curl installed (apt-get install php5-curl) in addition to the LAMP stack.  

There is a good video tutorial on porting modules available here.  It makes use of the coder module which seems quite good, although perhaps a bit pedantic on white-space warnings.  The tutorial on writing a drupal 6 module is also useful and is available here.  The module from the tutorial does work in spite of some of the comments folks left there.

Upgrading drupal point releases

Upgrading drupal between major releases can be a bit of a problem as I found out when upgrading from v5.5 to v6.  However, upgrading point releases can be relatively easy.  Note that to keep the URL constant and place drupal in its own file directory I use a symbolic link.  Depending on your web server you might need to set your configuration to handle that.

The strategy I use is to:

minor update to weatherfacti module

the xml service provided by weather.com has changed slightly. They now choke if some fields such as the id and key are empty in the request URL, so I've nerfed them for now. I will put in a proper fix later, but this will work for now... you can get the module here.

Please note this module is for Drupal 5.x, I have not tested it with Drupal 6. jonfrancisskydiver has created a version for Drupal 6 with some nice additional features available here: http://drupal.org/project/weatherfacti so please use that if you are using Drupal 6.

 

Drupal 5.5 upgrade to 6 fails

On Saturday I tried upgrading to Drupal 6 (from 5.5) and the upgrade scripts failed resulting in a rather horrible frankensite. I have not had time to debug the issue (it appears to have been a table conflict resulting in many invalid SQL statements that ended up corrupting the database used by Drupal). The good news is that recovery is quick and painless.

If you have not yet upgraded make sure you have a backup of your database, and install into a new location, not over your existing install (you can use symbolic links to preserve the name of the location you install to). To backup your database you can use mysqldump:

mysqldump -u adminuser -p databasename > backupfile.sql

where adminuser is the admin user account of your database server, databasename is the name of your drupal database, and backupfile.sql is the backup file that will be created. It will prompt you for your adminuser password.

To restore after the Drupal upgrade script does horrible things to your site, you need to:

Created Simple Weather Module for Drupal

Update: I updated my module for drupal 6.x and provide it here.

I could not find a Drupal weather module that did what I wanted (provided an N-day forecast for my area in small block-form), so I created my first Drupal module: weatherfacti. A small and simple module. It uses the free weather.com XML service to retrieve forecast data. The module is attached to this post or can be accessed by clicking here. Enjoy!

Syndicate content