DrupalEasy Quicktips are short, focused posts intended to accomplish a very specific goal. Quicktips are exclusively available first via our @drupaleasy Twitter account.

Forgotten Password - Reset it Using phpMyAdmin

When developing a Drupal site, sometimes you have the need to reset a password - either for yourself or another user. Often, when working with a copy of live data, I want to be able to login as another user who is already in the system. Rather than asking them for their password, I use this method to change it.

While Drupal's built-in "reset password" functionality or user editing capabilities work great, if you're like me and tend to work with your database editor open, there's a quick-and-dirty way to quickly change a user's password.

Do Not Use "admin" as a Username

Perhaps the most critical component of a Drupal site's security is the user login. For a login attack to be successful, the attacker must guess both the username and its password -- usually an impossible feat. But if the username can be easily guessed, that reduces the potency of this key security barrier. Far too many Drupal sites have "admin" as a username. Even worse, this is typically not a username assigned to a user who only has permissions for relatively innocuous capabilities, such as commenting on articles.

Change the Default Calendar View to Something Other than "Month"

If you use the most excellent Calendar module, then you probably know that it defaults to a "Month" view. Here's the easy way to change the default view to something different.

In your calendar's main view, click on the "defaults" tab, and then click to edit the "Date: Date (node)" argument. Simply change the "granularity" setting to whatever you want the default view to be and you're golden.

(I found this tip deep in the Drupal.org forums.)

Create Referenced Nodes On-The-Fly

If you use CCK's Node Reference field often, then this tip is for you.

Occasionally I run into the situation when I start adding a new node that contains a Node Reference field only to get half-way through before realizing that the node I want to reference doesn't exist yet. At that point I have to stop what I'm doing, open a new browser window, create the node I want to reference, then reload the original node's "add" form. What a hassle.

Module Development - Alternative to the "Are You Sure?" Screen

There have been several times where I've had to write a custom module that enables the site admin to make some major changes to their site. With changes like these, I want the site admin to be super-duper sure they know what they're doing, so while sometimes I use Drupal's built-in Confirm Form function, I sometimes decide to take a less-intrusive approach.

Low Hanging Fruit - Increasing Site Performance

One of the first things I look at when a client asks me "why is my web site so slow" is the admin/build/modules page (actually, the first thing I look at is the client's internet connection). It's very rare that I don't find more than a couple of modules that are enabled for absolutely no reason - sucking down precious server resources.

Here's a few that I find most often - and are usually no-brainers to disable:

Module Development - Manually Creating Node Revisions

If you've ever done any Drupal module development, then you've probably run across the node_save() function. This little beauty is the equivalent of the "submit" button on a node form. If you know anything about module development, you know that any module can tap into the "node save" process via hook_nodeapi(). By manually creating a node in code an saving it to the database with node_save(), you allow all the other modules on your site the opportunity to add their magic to your new node.