Redfin Family Grows

Redfin's family grew by several ounces this morning at 8:05am. Welcome Grayson! There are so many "views" for you to enjoy...

Ubuntu 10.4 Based Drupal VM Partition File System ext4 to ext3 Conversion

Due to the nature of our business, we have to test our sites on all different types of OSes and browsers. I have a Macbook, for example, on which I run OS X, Ubuntu 10.4 and Windows XP.

Could Not Find Custom CiviCRM Report Template

If you get the following message when attempting to create a report based on a custom CiviCRM CiviReport template,

Could not find the report template. Make sure the report template is registered and / or url is correct.

this is likely caused by an invalid template class value.

To fix this:

  1. Navigate to Administer > CiviReport > Manage Templates and click "Edit" on your custom template.

Show / Hide Fields In A Views-Generated Drupal RSS Feed

If you want to modify the fields included in a RSS feed generated by the Views 2 module, you have a few options including themeing the view, but the easiest way to simply show or hide certain fields and/or their labels is to simply go to the "RSS" tab when editing a content type's "Display Fields" settings. That's it. Below, I set a couple fields to not be included in my RSS feed since I didn't want, for example, the image name from showing up in the feed.

Format Drupal Calendar Module Mini Calendar Title View/Block

Theming the Date and Calendar modules can sometimes be a little tricky. I wanted to change the title display for a "mini" calendar in a block from "Month" to "Month YYYY" (e.g., "October 2010"). In order to do this you need to first learn how to override a theme function.

Now that you're up to par on theme overrides, we can override this theme function: /modules/date/theme/theme.inc: theme_date_nav_title. You'll have something that looks like this in Drupal 6.x.

CiviCRM Mailing Not Being Sent To All In Group

If you create a CiviCRM group with, say, 1,000 contacts in it and then go to create a mailing using the same group and it only says it will send it to 750, it's likely because some of those contacts are "on hold." On hold simply means that the system has determined the email address associated with the contact to be not worth sending to (i.e., dead). This could be caused by the emails bouncing for any number of reasons.

To avoid unnecessary continued bouncing, CiviCRM flags them as On Hold and prevents them from being included on future mailings.

Create a Redirect in Drupal's .htaccess For The Base URL

I recently needed to redirect a client's traffic from their old URL to a new one. In this case, they wanted any traffic going to plain example1.com to go to example2.com/blog and all other traffic to go to example2.com/[equivalent URI] (e.g., example1.com/about --> example2.com/about).

To do this, I messed around with rewrite rules and conditions for a while, until I decided on what seems to be a fairly straight forward solution:


# Redirect example1.com to example2.com/blog
RewriteCond %{HTTP_HOST} ^example.com
RewriteRule ^$ http://example2.com/blog [r=301,L]

Redfin Now Maintains The uc_profile Module!

Have you ever wanted a user purchasing something from ubercart to fill out their user profile at the same time? uc_profile module allows you to do just that. This becomes especially handy if users are purchasing memberships on your site using uc_roles and you'd like to collect additional profile information from them at the same time.

Thanks to cooperation from indytechcook, the uc_profile module's original maintainer, Redfin Solutions now manages it and is looking forward to releasing improvements in the near future.

Network At DrupalCon

Networking in most social situations is difficult enough, but when you throw thousands of (often) socially awkward and introverted geeks together, the task becomes even more overwhelming. And these aren’t just any geeks, these are Drupal geeks, which means you’ve got a ton of smart, dedicated and interesting people to meet -- it’s just that some might need a little nudge. If you haven’t already, I highly recommend “Work the Pond!” by Darcy Rezac -- it, along with my own experiences, is what powers the following advice:

Introduce Yourself

Private and Public File Access in Drupal

If you're like us, we usually only want to have SOME files "private" and not ALL files as Drupal is limited to all-or-nothing out of the box. There are some modules out there that do this, but honestly it's pretty easy to do yourself.

Let's say you don't want anonymous users (or search engines) to download any files in your sites/default/files/private folder. Create a .htaccess file in the folder you wish to protect and add the following and save (this is for Apache, but similar for Windows systems):


RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^GET$ [NC]

IE 7 and IE 8 Impose 31 CSS File Limit - Drupal Beware!

While debugging a client's site this weekend, I came across a rather dumbfounding issue. The site would look great in Firefox, but not in IE. In fact, IE seemingly ignored any CSS statements I would add to layout.css (part of a Zen-based custom theme).

If we look at the page source, Zen likes to add on a considerable number of CSS files along with several contributed modules -- over 40 CSS files total!

Resolving Drupal CVS Merge Conflicts

We manage our sites via SVN by first checking core and contributed Drupal modules from cvs.drupal.org. An explanation for this deserves its own post (coming soon...), but basically we check out from cvs.drupal.org and then import that into our SVN repository.

SVN add Updated Drupal Modules With Ease

With modules such as CCK, you'll often notice that after updating it via CVS that you are left with a bunch of new objects (new translation, css, and other files) in folders and subfolders. Rather than svn add'ing each file and/or subfolder independently, try this in the root folder of the module you updated:

svn add * --force

That will add all the new files you acquired with your most recent CVS update.

Hide The Drupal Files Folder From SVN

It's best practice to hide your "files" folder from SVN since you probably don't want to inundate your repository with and endless number of updates. If you do this:

svn propset svn:ignore "*" sites/default/files
svn commit -m "Hide the files folder"

Then you should be all set, and you won't see any more "?" when you do a svn status command.

Why Can't I Edit a Drupal Node That I Have Permission to Edit?

Okay, this one gets me all the time. I grant a role the ability to edit certain nodes and when they log in and try to edit a page, there's no edit tab!

Chances are that if you've tried everything else, you need to grant that role permission to use whichever input type you've set for that node or set of nodes. To do so:

  1. Edit your node and check what input type it is set to use
  2. Go to Site Configuration > Input Formats and then make sure that the corresponding input type is configured to allow the role to use that type.

Remove CiviCRM Contacts From One Group Who Have Unsubscribed From Another

We run several CiviCRM instances with our Drupal sites. One issue we ran into recently concerned contacts who unsubscribe from one group which was a subset of a larger group of contacts (of which they also belonged). When they would unsubscribe from one, they would still be subscribed to the other and thus were still receiving the newsletter. Aside from the fact that the group/newsletter setup was a bit un-ideal, we had to address the issue and manually unsubscribe the contacts from the other group. Here's how we did it:

Replicate MySQL's MD5() Function in SQL Server 2005 Using HASHBYTES()

MySQL and PostgreSQL's MD5() functions are nice, simple, ways to hash your data. Unfortunately, SQL Server 2005 and up (sorry, in order to get it working in SQL Server 2000, you'll need to try a stored proceedure), you can use the HASHBYTES() function.

In a recent SQL Server port of the Actions module for Drupal 5, I ran into the following MySQL query:


SELECT aid FROM {actions} WHERE MD5(aid) = '%s'

Why I Hate Microsoft