drupal

Add images to Drupal from your mobile device

iPhone camera

You can add images to Drupal, but mobile devices don't allow you to upload any photos to image fields. This is something that sort of irked me from time to time in the past, but recently came up for a website project, so I thought it would be good to see if it could be worked around.

HTML5 allows for this, but sadly that's mostly a no go with Drupal 7 at the moment. However, it turns out the fix is nice and easy via the HTML Media Capture method. Add the following snippet of jQuery, so it runs when pages load:

Sponsorship Success Metric

Hissy fit

Just after DrupalCon Sydney at the start of February of this year, I overheard some people wondering why they should sponsor a DrupalCon. Considering the people who attend, there's not a lot of product selling you can do if you're a Drupal shop and unless you're looking to hire delegates as new staff, there's not a lot of direct benefit from having a sponsor booth or table.

Obviously, helping to fund a DrupalCon and the Drupal Association via a sponsorship are good things to be doing for the community, but the payoff isn't necessarily immediately apparent. However, there definitely is one. There just hasn't been a metric for it, let alone a testable metric.

Announcing the Drupal 8 Compatibility API

Drupal Compatibility

For some time now I've thought that I don't like the direction Drupal 8 development is heading in. The code base is getting larger and larger, the code is getting slower and slower and the mix of plugins and annotations that replaces hooks makes the development experience far less consistent.

On top of that, the PSR-0 "standard" means humans have to now write code that is more convenient to parse for computers than for other humans.

The Spam War

The spam war

As things on the internet go, not many are worse than spammers. At best they're nuisance, at worst the hardware, cycles and power wasted on dealing with them is causing global warming and pollution at an ever accelerating rate.

I'm most annoyed by the wasted cycles. When I run a web site, I'd like to use the CPU power I pay for to be used to serve (admittedly mediocre) content to people that might get some (questionable) value out of them.

Testing times

Crash test dummy

Over the past week or two I've spent my time working on a Drupal install profile. It uses a custom theme, a bunch of features and a set of modules that allows us to use Aegir to quickly provision a standard website for research centres and projects and associated with our university faculty.

To make sure this install profile keeps working as we make incremental improvements to it, I decided it would be nice to have some tests. For instance, to check that the correct theme is enabled, that the various roles defined in the features we use have the correct level of access to the nodes defined there as well and that blocks are placed in the correct regions with the correct visibility settings.

Unfortunately, the default DrupalWebTestCase class doesn't run profile install tasks, so my tests all failed horribly no matter what I did. 

Date ordinals: An ugly solution to an ugly problem

Root out the unilingualist oppression!

A friend bumped into what appears to be a very irritating problem yesterday with the PHP date_format() function, which is used by format_date() to show date and time strings on Drupal. This function uses the "S" format character, which returns the english ordinal number suffix for the current day of the month. E.g: "st" on the first day, "nd" on the second day, and so on. (And the date() function does too, coincidentally)

The problem is that when you're working in a non-english locale, the ordinal suffixes returned remain the english ones. Oops.

Drupal Groups Email Filtering

You've got way too much mail

Many Drupal users and developers are members of groups.drupal.org and will be getting email from the site when people post new messages and replies to threads. Of these people, many probably also like to organise their email in folders, for easy reference in the future.

A common way to do this is by creating email filter rules that look at email subject lines or other headers and perform an action based on what these headers contain.

Value Added Tax?

Could it be? No! Never!

A few weeks ago I saw a tweet by the Drupal Assciation asking for feedback on, amongst other things, how it could make being a DA member more attractive. The survey appears to still be open, so if nothing else please go fill it out.

However, before you do so I would draw your attention to question 15:

How much would the following benefits interest you in becoming a Member (or renewing your Membership)?

and in particular one of the options listed there:

Sensible API Calls Initiative

Frightened and confused

More than once I've had people ask for help because the concept and naming of hooks in Drupal both frightens and confuses them. FRIGHTENS and CONFUSES. Sadly, this is a very common occurrence.

In order to address this problem, the SAC (Sensible API Calls) Initiative has been formed. Our first task has been to clarify and simplify alter hooks throughout Drupal. We've opened issue #1510984 on drupal.og and posted an initial patch, which addresses how the alter API is called.