Drupal

editing acquia theme

For the spotmouth.com site, I started by writing a new theme, but in the end, decided to just edit the acquia theme.  One issue that I had was that this theme uses some background images.  While I could  (and initially did) just edit the images to match the color scheme for my design, it didn't feel right.

I wanted to way a way in CSS to remove the background-image that the theme was setting.  I added the following to my local.css and VOILA, it worked:

 

post registration redirect

For spotmouth, the user management is in Drupal.  When a user registers, they are by default redirected to the Drupal front page.  For spotmouth, this automatically redirects the user to the grails portion of the app, so a) user does not see the "check email" message that drupal provides.
What I wanted to do was direct the users when they register to a thank you page.  This was easy, I just created my "thank you" page in the CMS and installed the "Rules" modules.
I created a new rule for when users are created, and did a page redirect to my Thank you page.

Apache solr and drupal gotcha!

 
I setup a 2nd solr instance for spotmouth.com for my drupal instance.  Anytime I tried to run cron.php to get drupal to index my content, I got an error:
Cron run exceeded the time limit and was aborted.
No content was ever indexed.
The problem was that I had a Drupal page that contained php content (do redirect to the spotmouth.com application). Once I changed it to use a different input filter than PHP, the cron job functioned perfectly.

Do not forget to make your module blocks Configurable

 

We needed to perform some regression testing on a production server of a Drupal module.  The Drupal module output a block and we needed to display this block on a simple Testing page so as not to affect other parts of the site.  I uploaded my changed module and proceeded to configure the block so it would only appear on this specific page.  ERROR.  Total white screen of Drupal death.

The evil block cacher

There are two things that I have learned recently with Drupal

1) Caching of blocks can be enabled/disabled.  It is highly recommended to turn on this caching for production sites.  Your site can be heavily hammerered if you don't enable this.  I learned this firsthand. It would triple the time to execute a page.

2) Even if you enable the block cache, individual blocks that your custom module exposes can opt out of being cached (more on this later)

Testing drupal with grails webtest

I was implementing a Drupal site with a custom module that uses a custom mysql database.  The client reported problems with a custom module.  I tried reproducting the problem, but after trying 20 some combinations out of 1000+ test elements, I wasn't able to reproduce the questionable behavior.

Enter grails with webtest.

simplenews bounce, i give up

I have spent some time installing a configuring the simplenews bounce module.  It does say up front that it's experimental, so can't be mad at anyone but myself here.  However,  I am giving up.

1) I am using mime-mail, since I am sending html email, so I had to patch that to that my return-to path was set

Login Security:Call to undefined function ctype_alnum()

After installing Login Security, I attempted to configure it in the Drupal administration screens.  I was unable to perform any configuration due to the following error.

[Wed Oct 21 11:02:53 2009] [error] [client xxx] PHP Fatal error:  Call to undefined function ctype_alnum() in /opt/sites/xxx/sites/all/modules/login_security/login_security.admin.inc on line 214, referer: http://xxx/admin/settings/login_security

Change tab names

Needed to rename the tab on the user form.  Found a nifty way to do this by using the hook_menu_alter function.  I added this to my custom module:

function gl_customizations_menu_alter(&$items) {
 $items['user/password']['title'] = t('Email Password Request');
}

 

style.css media="all" causing conflicts with print.css

When the $stylesheets variable is output in my template, it contains a reference to my theme's stylesheet with a media="all" that is conflicting with the print.css.  I did a lot of searching and found several people who proposed different solutions

Syndicate content