drupal

Set Drupal cache and aggregation settings in settings.php

Drupal 6:

$conf['preprocess_css'] = 0;
$conf['preprocess_js'] = 0;
$conf['cache'] = 0;

 

 

Set Drupal files directory path in settings.php

In Drupal 6 settings.php:

$conf['file_directory_path'] = 'sites/yoursite.com/files';

In Drupal 7 settings.php:

$conf['file_public_path'] = 'sites/yoursite.com/files';
$conf['file_private_path'] = '/var/_private-web-files/yoursite.com';

 

Hudson import_site (Mercury) job

While using Hudson's **import_site** (Mercury) job to import my Pressflow site into my new Mercury server, I came across the following issues:

1. At first, I thought I'd be able to point the TARBALL argument to a remote http:// url.  This did not work.  I had to point to a local location.

2. Then I had to point to the untarred location, instead of the .tar file.  (When pointing to my .tar file, I got this error: `Fatal error: Archive file "http://www.example.com/myarchive.tar" does not exist.`).

Why won't my site send mail!?

After moving my sites to KnownHost, my Drupal sites (6 and 7) aren't sending emails out..  On the site for which I actually could remember my password, I eventually got it to send mail by enabling (with some config trouble) the SMTP module.  Now for this one....  sendmail works...  php's mail() works... WTF?

Pressflow dog

Pressflow dog

I set up a private git server for my projects

Created my project

I checked out pressflow/6.git

renamed tracking remote 'origin' to 'upstream'

created new tracking remote 'collab' pointing to my project repo on private git server

... now, i need to:

Multiple Forms on One Page

I noticed a bug on my page where one form in a block was being submitted to another form that was in the body of the page.

By default, when a form has no "#action" defined in the $form array, it will post to itself--on whichever page it is displayed--and magically work :)

But when you have more than one form on one page, make sure each form has an #action property set to a valid menu callback that routes back to drupal_get_form for each form.

:)

Funny Drupal Taxonomy Term (ID)s

I find it funny that the taxonomy term ids on drupal.org, for some older versions of Drupal, happen to match those versions' numbers.

Drupal 4.5.x tag is at http://drupal.org/taxonomy/term/45

Drupal 4.6.x tag is at http://drupal.org/taxonomy/term/46, and

Drupal 4.7.x tag is at http://drupal.org/taxonomy/term/47

Drupal Site Upgrades with Drush in Git/Eclipse Workflow

I've got a Drupal 6.14 installation recently initialized as a Git repo that I now need to upgrade (from Drupal core 6.14 to 6.19 and to the latest versions of several contributed modules.  To safely upgrade this site I'll perform the upgrades locally and make sure they don't break any of the functionality - especially in the features from custom modules which may have been written against these now outdated versions of some important modules.  So the idea is to create a branch from the current code to a new line of development for these upgrades.  I'm familiar with SVN branch

Displaying Drupal Block based on Node type and path


<?php
$match = FALSE;
$url = request_uri();
$types = array('product' => 1);
$pages = array('store', 'shop', 'cart');
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
$type = $node->type;
if (isset($types[$type])) {
$match = TRUE;
}
}
foreach($pages as $page){
if (strpos($url, $page)) {
$match = TRUE;
}
}
return $match;
?>

Syndicate content