In the last weeks I did some work on optimizing queries for the "Manage Supporter"-Interface in campaignion (online campaigning / online fundraising distribution). The goal is to filter Redhen contacts and then apply bulk-operations on them. In our larger databases we have up to 500,000 contacts and millions of activities - and the queries are not that simple either. How do you get “All supporters that signed at least two petitions last year but never made a donation”?
Usually when you try to uninstall a field-based module you're confronted with the following error message:
[module] is a required module and can't be disabled. Reason: Field type(s) in use - see Field list
In this blogpost I'm showing you how to uninstall such a module anyway (deleting all the stored data).
This week I've finally found the core of several issues that I've had in the past. Are you using install-profiles or features? Then this bug is likely to have affected you too.
Recently I came in a situation where I wanted to extend all entities of a specific type (payment) to reliably provide (and store) an additional property. At first glance this seems like a no brainer: simply use hook_entity_* to save/update/load the property to or from the database and that should do it. Turns out it isn't … and there is a lot to learn about how entities work in D7.
Lets take a look at a specific example.
A few weeks ago we've released our first public open-source version of Campaignion. It's a tool that helps non-profits and NGOs with online campaigning, fundraising and digital marketing. In this blopgost we'll explain some of the technical background and how it works.
As the title suggests we have Drupal hosted behind a reverse proxy. Usually this doesn't matter a lot, but there are few things like IP-blocking or oauth that need to know some data about original request. Namely that's: The client-IP, whether the request was issued via HTTPS and the server port. Here is how to achieve that.
Here at more onion we're hosting most of our client's sites ourselves. This means we are hosting lots of sites which share most of their modules (ie. our standard Drupal installation). Reproducible setups, fast builds, sharing-module code among many sites -- This is where our new build-tool called dbuild.py comes in.
It started out as yet another wrapper around
drush site-installbut became a fully fledged download-extract-patch-symlink tool in the end.
There are times when you want to display parts of an entity to the user, pariticularily a specific list of fields that are attached (bundled) to that entity. Core doesn't offer functionality for this so I'll show you a simple function for extracting the form array structure for a selectable list of fields of an entity.
During development of the pgbar module I often ran into Notices for something in
$items. This time I said to myself: Let's get this straight once and for all. So I've inserted some debug code into my module to track which field related hook can manipulate data and in which order they are called. You can see the result in the dot-graph at the bottom.
Replacing checkboxes with itoggles is a usability improvement and makes Drupal administration more mobile friendly. After a lot of work we've managed to get it working and here is how...