Drupal code

  • Storing data in Aegir

    Aegir is a very clever Drupal hosting system built using Drupal and Drush. It is divided into two parts: the frontend and the backend. The frontend is essentially just a standard Drupal site that stores its data in the database and then some drush scripts that manipulate the data. The backend (provision) is just a collection of drush scripts, and it stores its data in Aegir contexts which are essentially just arrays of data stored in text files on disk. One of the most mysterious processes in Aegir is sending data from the frontend to the backend to be stored in these contexts. Recently I cracked this mystery, and I'm going to explain how.

  • Aegir tasks daemon

    Aegir is a very clever hosting system for Drupal that sites and provisions them on various servers and does lots of clever things. One of the clever things that it has had for a while is a task queuing system. You can ask Aegir to lots of different things all in one go, and Aegir will queue them up and run them at its own pace. This provides a really good separation from the front-end Aegir website and the back-end Aegir scripts.

  • Setting default theme during installation

    Here's a quick post that will be a reminder for us as much as anyone else! Setting the default theme during installation using an installation profile is surprisingly hard in Drupal 6, and easier though not obvious in Drupal 7. In Drupal 6, we used the wonderful Install Profile API module, which allowed us to do it in just a few lines in an install task:

  • CTools Path Access plugin

    I made a new Drupal 7 module today... the CTools Path Access plugin. It is a very simple module that provides a CTools access plugin for using the access rules of another path.

    For example, you might set up a custom Panels search page in Page Manager, and just want to use the same access rules that the default Drupal search page uses at /search.

  • Playing second fiddle

    While at Drupalcon I couldn't help but want to get involved in core development of Drupal. I have been involved on the fringe of Drupal core development for a number of years, and I've found bugs, submitted patches, tested others' patches, fixed others' patches and contributed documentation, but to get really involved in development you have to basically immerse yourself in it. It's really hard to follow the issue queues and get any sense of what is going on in the Drupal community. I just don't have the time to invest in core development.

  • Drupalcon Chicago - Core conversations - Content vs Configuration

    Drupalcon Chicago had a track for 'Core conversations' that were discussion focused and about the future of Drupal core.

    On the first day there were two sessions essentially about managing content and configuration in Drupal. They focused on the differences, similarity and possible solutions for moving content and configuration around and between sites.

  • Boosting Solr search results at query-time

    Boosting terms in Solr search results produced by the Apache Solr Search module that integrates Solr with Drupal is something we had to do for a project recently. If a user has come to our website from a search engine, we can pick up the terms that they had originally searched for - and then boost any documents containing those terms in our own search pages, regardless of what they search for on our pages.

  • Drupalcon Chicago - Keynote - Dries Buytaert

    Dries kicked off another Drupalcon today by giving his keynote presentation to the community. If you missed it then you can view it on the Drupalcon website but read on for my summary and thoughts.

    Dries has been doing these keynotes for a while now, and every one gets better and more polished. Today's was no exception. Dries summarised the process of Drupal 7 development and suggested changes and improvements to the Drupal 8 development workflow. He also outlined some of his priorities for Drupal 8.

  • Using project mercury/pantheon for hosting a Drupal site

    We have been using mercury/pantheon to host sites for a while now, we love the fact that you can get a fully configured Drupal hosting environment with all the trimmings for very little work. Specifically we have been using linode for our actual hosting, they are well priced, offer a good product and (this WAS the deal breaker) have mercury/pantheon "stackscripts" ready to roll (a linode stack script is essentially a build script you can use to setup your fresh server).

  • Quick tips: Inspecting a Solr Document

    Another quick tip here: if you're working with the Apache Solr module, specifically looking at the documents that are being created from your nodes, and you want to print out the document and have a look at what fields and values are on your $document then if you did this:

    // Print the $document using the devel dpm function.
    dpm($document);

    Then you would get a very unhelpful output from Krumo, because all the fields on the $document are protected, and so the devel module can't access them. Instead you can do this:

    dpm(array_combine($document->getFieldNames(), $document->getFieldValues()));

    And you'll get a nice array of field names mapped to their values.

Pages

Subscribe to Drupal code