Operator precedence gets me every time!

While working on a module last night, I couldn't figure out why I couldn't get caching to work. I have done object caching at least a dozen times before but I couldn't figure out why I was not able to get the cached object back. Here's the code I was using:

<?php
 
if($cache = cache_get($cid, 'cache') && $cache->data) {
   
dsm('Cached!');
    return
$cache->data;
  }
?>

I finally realized that cache_get() was indeed returning a cache object, but the code inside the if statement was never executing.

Book Meme

It's a good bet their new vocabulary includes words that are linked together, such as "evil" and "abortion," "gay" and "sin," and on a more wordly note, "Republican" and "Chrisitian."

- From The Hijacking of Jesus: How the Religious Right Distorts Christianity and Promotes Prejudice and Hate

Firefox is out of control!

1.76 GB of memory for Firefox!!!

Keep It Simple

I'm always on the lookout for a high-quality html/css template. I found StyleShout.com after reading Walkah's post about building a Drupal theme out of the VectorLover template. That's where I found KeepItSimple, a simple, clean and full-featured template.

Time sensitive data caching

I've been working on this rather large project that must make several REST based web service calls for each page generation. Each call can be cached for a different amount of time, ranging anywhere from 1 minute to 1 hour depending on the method being called. So I set out to make sure that the results of all of these calls were being cached for the appropriate amount of time.

theme_username woes

I got an email the other day informing me that a blog author on a site I had build could not post comments on his own blog. Authenticated users were not having the same problem, just the blog author. So using devel, I switched to his user account and tried it myself.

"You have to specify a valid author."