DrupalCon San Francisco 2010

Drupal Quick Tip #10: Avoid critical errors when demoing development code

Inevitably during your development process, the client is going to want to see how things are going. And typically in these cases you don't want to demo on the actual development environment. So you setup a test site to demo everything which may or may not contain all those lovely Drupal development modules (i.e. coder, devel, etc...). And if that's true, what if there are stray 'dsm' calls in your committed code? I mean it's safe to assume you grabbed a copy from your repo which is still under active development so it's safe to assume there's some dev code in there. And that code will cause critical errors with those dev modules missing. The last thing you want is to show big error pages during a demo!

Now I know this is a lot of if's but it could happen (trust me...). Here's how to avoid it:

What you'll need: Your fingers and cooperative developers

Drupal Quick Tip #9: Link Checker

Tired of hunting down dead links manually? Well this module may be just what you need. Link Checker automatically checks all links in all nodes and repots on those that are broken. It even tells you why you can't reach the link (i.e. 404 File not found, 500 Internal server error, -101 Connection Timeout, etc...)
What you'll need: Link Checker Module, cron configured
How to do it:

Drupal Quick Tip #8: Admin Module

This isn't so much a quick tip as much as it is an ad for the phenomenal Admin module which I've recently discovered. It adds inline content editing, views administration, block editing, a newer and much improved administration section layout and a great toolbar at the top of all pages. Here's how to setup it up:

What you'll need: Admin module

Daisy chaining commands - Redux

A while ago, Mat posted a blog entry regarding running multiple commands on the same line.  While queuing up commands like that is an invaluable feature of any shell, what do you do if you want to run commands that depend on each other?

As an example, imagine a program that operates on the current working directory, so you want to change to the target directory, then run the script.

cd /var/www/html/mysite/tmp; /usr/bin/my-script

But what if something went wrong? What if the directory didn't exist or you didn't have permissions to enter it? Your script would be run, but not in the directory you intended.

Luckily for us, there is '&&'. Like ';', '&&' allows you to run multiple commands at once, but it only runs the next command if the current one exited successfully.

So instead you could run:

cd /var/www/html/mysite/tmp && /usr/bin/my-script

Preventing PHP WSOD (White Screen of Death) in Drupal

As much as I love using Drupal, every once in a while something goes horribly, horribly wrong. Mind you, in most cases, I may have had a hand in the error (updated the wrong module, forgot a file or two, etc...) but the end result is the same; the dreaded WSOD (White Screen Of Death). These occur when PHP has some kind of error while processing your request. The problem with this is the user, unless they're technically inclined, has no idea why all they see is a big blank white screen (I'm assuming you've disabled the output of errors to the page in production. If you haven't, what are you waiting for!). Not only that, they'll just keep refreshing the page and potentially adding to your problems by having half executed PHP code running a muck on your data.

Choosing the right CMS

I couldn't have said it better myself.
 
http://www.noupe.com/php/choosing-cms-tips.html
 
Great list of tips/questions to ask to choose the right CMS for you. In case you're wondering, Drupal passed this test for us ;-)

Drupal Quick Tip #7: Drupal behind a reverse proxy

I recently had to setup Drupal behind a reverse proxy server. (If you don't know what a reverse proxy server is, check it out on Wikipedia) One thing people may not realize about this sort of setup is if you want your logs for your visitors to show up properly, you need to change a setting inside your settings.php file. Here's how.
What you'll need: Drupal, a reverse proxy server
How to do it:

UNIX Quick Tip: Daisy chaining commands in the terminal

I discovered this this morning. I'm working on a tomcat application and I have to stop the server, deploy some theme changes with a script then start the server up again (I know, it's a dumb setup but I didn't write the app, I'm only using it ;-) So I'd type "stopcp" to stop the server, then the deploy skin script, then I'd type in "startcp". But (and this may have been obvious to everyone but me) if I put a semi-colon between the commands, I can have all three run one after the other automatically.

Example:

stopcp; deployskintemplate -t classic; startcp

Saves me from having to do three things. I can just sit back and watch it go. Hopefully you find this useful!

Home-less iPhones: What to do when your iPhone / iPod's Home button stops working.

(Those not interested in my rambling exposition but just want the tips should skip on down to here)

Tomorrow can't possibly come quickly enough.

I don't mean that in some lofty, philosophical way. I mean quite literally that tomorrow, June 19th can't possibly come quickly enough. I've been counting down many, many days until the newest iteration of the iPhone is released. I can already hear the eyes rolling, because it seems half of the Internet has been also looking forward to it (and the other half seems hell-bent on telling us why we're stupid, but that's another post altogether). Bear with me, though, and I'll explain why.

Firebug + measureIt = A great team!

Have you ever tried to match the exact alignment your designers created for you on a web page but you're having a hard time telling if they line up? Well I was, and until just now (literally a few seconds ago I discovered this) it was a giant pain. But if you use two amazing Firefox extensions together, you can make your life a lot easier (I know it helped me).

Syndicate content