Drupal file_copy won't work outside of the Drupal instal

The selected file could not be uploaded, because the destination is not properly configured

This "feature" has bitten me before. It's one of those annoying Drupal things which would be fine if the error message wasn't so misleading.

What's happening is that file_copy() calls file_create_path()

<?php
function file_copy(&$source, $dest = 0, $replace = FILE_EXISTS_RENAME) {
 
$dest = file_create_path($dest);
?>

While file_copy() doesn't declare that it only works in the Drupal folders - file_create_path is clear about this.

Read more

Drupal multisite with shared tables

Drupal allows you to create multiple sites sharing some or all of the same code and optionally sharing some database tables.

The documentation for the Drupal settings file
http://api.drupal.org/api/file/sites/default/settings.php/5/source

includes the following

<?php
/*
* To have all database names prefixed, set $db_prefix as a string:
*
* $db_prefix = 'main_';
*
* To provide prefixes for specific tables, set $db_prefix as an array.
* The array's keys are the table names and the values are the prefixes.

Read more

What is a Drupal node?

One of the things that is confusing about Drupal is the use of the word node.

Going to the dictionary doesn't help much:
http://dictionary.reference.com/browse/node
http://www.answers.com/topic/node

In my opinion "node" is just the wrong word.

When you read node think content.

Content (in the context of a website) means something that is displayed to users.

Content can be text, images, video, even flash games.

So when you create a node in Drupal you are creating content.

Read more

PracticalWeb Joins Drupal Association

PracticalWeb Ltd today joined the Drupal Association

Drupal Association Membership Badge

The membership fee helps support the drupal.org infrastructure and marketing costs.

It's  also a small thank you for all the terrific work built up by the whole Drupal community.

 

Read more

Install runkit for unit testing

Unit testing Drupal can be pretty challenging as it's hard to isolate parts of the code.

It seems :

Read more

Drupal Object Orientation

One of the surprising things about Drupal is that it doesn't use object oriented coding.

There's a good page in the Drupal documentation about this

http://api.drupal.org/api/file/developer/topics/oop.html

It makes a good case for the design of Drupal, and goes a long way to explain why Drupal feels more OO than the code looks at first glance.

There has been discussion on the mailing list

Read more

Time to upgrade to Drupal 6?

Drupal 6 has been out for a while now, Drupal 7 is in the works, and yet most sites still seem to be using Drupal 5. Is it time to upgrade yet?

If it was just the core features the answer would be simple, Drupal 6 is better and is fully stable.

The problem is that many (maybe most) of the features of a Drupal website are powered by contributed modules, and modules written for Drupal 5 don't work with Drupal 6.

Read more

guycollection.com: Drupal and ecommerce

Earlier this year I was involved in a very satisfying project: the GuyCollection website is an online shop selling boys clothes for a new company.

The project was design led, and my role was to turn flat designs into a Drupal theme while altering the ecommece module to work in the way envisaged by the designer.

guycollection.com 

www.guycollection.com

Read more

Keep Your Drupal Theme Simple

When creating a Drupal theme it is tempting to start with one of the existing themes (Zen and Garland are often used) but I would argue against this approach.

If you start from another theme it feels good at the beginning; after all you start from a position where your site looks good. But the more customisations you make, the more you find that the old theme just adds complexity to your existing theme.

The way Drupal works is that each module can add it's own CSS: so tabs, menu trees, filters and so on all come with some sensible styling by default. If you want it to look different you not only have to create the CSS to make it look how you want - you have to make sure this overrides the default rules.

So CSS in Drupal isn't simple - don't add to the complexity more than you need to.

Read more

Mobile Internet reaching Critical Mass?

Interesting report on the state of mobile internet

We offer that mobile Internet is today at a point of sufficient mass to sustain a chain reaction of rapid growth in consumer adoption and, in turn, mobile Internet marketing.

According to this in the UK 16% of mobile phone users use their phones to access the internet.

These users access a much smaller range of sites on their phones than desktop users do.

Read more