Free tagging: 

You're maybe at one of the many Drupal Co-worker Friday events that are taking place around the world today. You've packed up your laptop and your lunchbox, and you're looking forward to a day out of the house with some human contact.

Piping A File In To MySQL

Our use case here is if you have a lot of data you want to insert in the MySQL - data that you might usually use the Drupal UI for, but there's so much of it you'd rather not if you can help it!

The example here is for a client of ours. For this particular client we have to launch a few new sites a month, each one comes with a new access list of email addresses to add to the Drupal "Access rules" page. There's no bulk upload, and doing these one by one with the UI is laborious, to say the least!

There are several modules that provide taxonomy term widgets that are more efficient at drilling down into large and complex vocabularies of terms, but I've not yet found something that just limits terms in some way.

The use case is somewhat like this: I have products that are classified by sport and by team. And teams can be rugby teams or football teams, and so on. Having one vocabulary per type of team feels somewhat weak, but putting them all in one vocabulary means the user has to wade through a lot of irrelevant terms.

Dynamically changing Views table joins

I've recently had cause to make Views make joins to tables in peculiar ways. Here's some notes on the peculiar things I did with the views_join class to accomplish that.

First of all I'll briefly recap how we define a table to Views. Each item in the $data array returned to hook_view_data() represents all the information about a table. Each key in the array is a field on that table (well, or pseudofield), except for the 'table' key which has the basic data about our table, like this:

Look, Drupal 7!

This is now my first Drupal 6 to Drupal 7 upgrade. Not without hitches, but all in all not too painful. Hope you like the new look. As dedicated readers may know, I never stick with the same theme between major Drupal releases, more often than not because my previous theme was never ported and I can't be bothered to port it myself. The new theme is the rather pretty Corolla, which you can find here:

Here are some Drupal 7 upgrade notes and links others may find useful.

I've been poking in the innards of the menu system the last few days. This is due to yet another client wanting to do something that goes completely against the grain of Drupal.

Security Releases Don't Work

Wow, long lapse in posts there. Sorry folks. On with the show:

Here's the problem. The Drupal security team do a fine job, following up on reports, auditing contributed modules with a point release to check for security weaknesses, working on core. It's all good, except for one thing:

Contrib release process.

The Oxford Comma

Here's a little function I wrote today because I needed to be able to turn a list of between one and three items into a string like 'apples, oranges, and pears', 'apples and pears', or just 'stairs'.

I figured I might as well handle everything in one place, and throw in the option to have an 'or' instead of an 'and'. There may be occasions you don't want the Oxford comma, but I can't think of any.


Using Constants For Permission Names: WHY?

I keep seeing this sort of thing in so many modules:

define("MY_MODULE_PERM_ACCESS_WIDGETS", 'access widgets');
// Names changed to protect the guilty ;)

Am I missing something, or is this utterly pointless?

Setting Up Git And Gitosis On CentOS 5.2

This article is a tweaked version of several tutorials around. Many of the original links courtesy of Adrian Simmons. Thanks to all the others who gave me loads of help in IRC and thanks to Jerad at Lullabot for inspiring me to dive in to Git with this article.


Subscribe to RSS - drupal
© 2010 Greg Harvey. Drupal theme by Kiwi Themes.