Drupal

Google webmaster reports page unreachable but users can browse page

Posted in | »

In this case the Google webmaster crawl reporter was indicating a large number of pages in a Drupal site as unreachable - 500 error. Users however could access the problem pages without difficulty or delay.

Submitted by Jonathan Mitchell on Mon, 06/07/2010 - 20:29

Creating favicon ico files on OS X

Posted in | »

The ICO image format is a Windows format for representing icons at various resolutions. It is also widely used to represent favicons. It is thus somewhat similar in intention to the OS X ICNS format. Indeed you can create and edit ICO files using the Icon Compose app that ships with Xcode. It lives in /Developer/Applications/Utilities/Icon Composer

Submitted by Jonathan Mitchell on Mon, 06/07/2010 - 15:48

Automatically log in authenticated Drupal user

Posted in | »

In some cases it may be desirable to externally access authenticated user paths on our Drupal site. I use this approach to kick off various admin functions.

Submitted by Jonathan Mitchell on Tue, 04/06/2010 - 20:57

Duplicate a Drupal Installation

Posted in | »

We want to duplicate an existing Drupal installation for testing purposes. In this case the duplicate will reside on the same Fedora 8 server.

Our original live domain is www.example.com.
Our duplicate domain will be dev.example.com.

Submitted by Jonathan Mitchell on Sun, 04/04/2010 - 19:08

Automatically extract zipped attachments received on postfix mail account

Posted in | »

The desire here is to call a Drupal path when email is received on a specific email account. The email in question contains a zipped archive of images that we want to import into Drupal.
Submitted by Jonathan Mitchell on Fri, 03/26/2010 - 09:46

Drupal on mac OS X using XAMPP with virtual hosts.

Posted in | »

The use of virtual hosts allows us to effectively develop using XAMPP in a way that is similar to final deployment. It also allows for multiple installs of Drupal and permits developing for multiple sites using a single Drupal installation.

In this case we are aiming to set up a development virtual host installation with a URL of www.mugginsoft.local

Submitted by Jonathan Mitchell on Sat, 08/01/2009 - 21:50

Make Drupal 6 View Filter Selection Match View Argument

Posted in | »

The Issue here is that when filtering a Drupal 6 view using an argument the block filter selection does not match the argument.

Submitted by Jonathan Mitchell on Thu, 07/02/2009 - 22:10

Create a Drupal 6 View Block Based on Taxonomy Term

Posted in | »

Your Drupal view can be expressed both as a page and as a block. You can also filter your views content according to a taxonomy term argument. And now you want to generate your block according to the presence of your taxonomy term in your URL (either within a menu path or view search block request generated URI).

Usage

Just call MyViewBlockFromURI() wherever you require it. Stick it in a block if required. Also very handy in the header of a view - you can tie the view header into the content using the taxonomy term extracted from the URI.

Code

Submitted by Jonathan Mitchell on Tue, 06/30/2009 - 11:23

Getting and Setting Cookies in drupal_http_request

Posted in | »

A Drupal 6 http client request is constructed so:

$http_results = drupal_http_request($url, array(), 'GET', NULL, 3);

Some URLs, however, require that a cookie is passed to each request to ensure that a correct response is issued. First, however, the cookie must be retrieved from an initial request.

$http_results = drupal_http_request($url, array(), 'GET', NULL, 3);
$cookie = $http_results->headers['Set-Cookie'];
$headers = array('Cookie' => $cookie);
Submitted by Jonathan Mitchell on Sat, 05/30/2009 - 15:13

Storing Drupal Hierarchy in Subversion

Posted in | »

Often it may prove desirable to push an entire Drupal hierarchy into subversion. The example only provides for local file access.

On Fedora 8 subversion is already installed. To check if installation already present.

rpm -q subversion

Login as root and create subversion root dir and children.

[root~]# mkdir /svndir
[root~]# mkdir -p /svndir/repos
[root~]# mkdir /svndir/users
[root~]# mkdir /svndir/permissions
[root~]# chown -fhR webmaster.apache svndir

Now create repository for our html dir.

Submitted by Jonathan Mitchell on Sat, 05/30/2009 - 13:03