I recently built a Drupal site on an Apache server sertup and everything seemed fine until someone running IE8 tried to download a .docx file. For some reason IE8 insisted that this file was a .zip file and would open it as such, causing a bit of confusion as to what the problem was. I assumed that this was due to the mime type of the file not being set properly, but I decided to do a quick search to see if I could find anything to corroborate this. I thought it might be something odd that IE8 was doing as everything else was downloading the file perfectly.
Use the following rules in your Apache configuration (or your .htaccess file) to redirect all traffic from one domain to another. This also keeps the query string in place so that the user isn't just dumped to the homepage.
I'm always writing bits of script to test things out and I thought that I would start making a record of them in case I need them in the future. This is a little script that will loop through the contents of a text file and validate that a bunch of 301 redirects point to the place they are meant to point to. This script assumes that the redirects are already in place on the server, but this is what I was testing. Here the format of the redirects text file.
Drupal is capable of sending out a few different emails to users depending on different actions. The emails can be customised quite nicely with usernames, passwords, email addresses and other things by using a set of tokens. The password recovery email states that you can use the "!password" token to send the user their new password, but after a few tests I found that this token doesn't get replaced when the email is sent out.
I often get asked a simple request during a project, and the solution to the problem is sometimes more complex than I originally thought. One of these problems was adding a WYSIWYG editor to the summary field on the node edit form. There isn't an easy way to do this, but it is possible to get a good solution working.
I recently noticed a strange little issue with Drupal 7 that seemed like either an oversight or a decision I don't agree with. Essentially, when a node is created with a menu item in place the extended flag on the menu will not be set, but the control is also not available on the menu admin page. This means that when you are trying to print out a hierarchical menu structure you need to create the page, go into the menu admin area, access the menu, click on edit to access the menu item and change the setting there.
The other day I was approached by a friend (Julie Cheung) and asked if I could create some code that would display a list of last played tracks from last.fm. Julie isn't a PHP developer and so the code I gave her had to be easily understandable so that she could edit it herself if needed. The following code is what I came up with.
A tabledrag form in Drupal 6 is any form that will allow you to move items up and down the list or into a hierarchy of items. This is actually a component of Drupal itself and is used on forms like menu, taxonomy and blocks management. Tabledrag is a great way of allowing your users to move items up and down a list with ease and they will be used to the mechanism from other areas of the site.
Understanding what it is that the client needs is an integral part of software development. The client will usually help you out by telling you what they need the system to do. What you will generally have is a big list of the things that the system should do. Rather than explain the difference between the terms "function requirements" and "non-functional requirements" to the client, you can save time by using MoSCoW.
Phing allows the running of SSH commands on servers and the copying of files to servers via SCP. Before you can use SSH and SCP commands in Phing you need to install the PECL extension SSH2. The SSH2 PECL extension requires the libssh2 package, so you need to install that before you can get started. The following install instructions are based on a Linux environment.
Download the libssh2 package from www.libssh2.org and install it by using the following commands. Your package version may vary.