Recent Posts

IntroductionConsider the following scenario: you’re on a long-distance multi-day bike ride, you have your laptop with you and you need to run a long process on a remote Ubuntu server, something like importing a huge database, which might take upwa...

This article discusses how to use HTTPS for local development if you use Docker and Docker Compose to develop Drupal 7 or Drupal 8 (indeed any other platform as well) projects. We’re assuming you already have a technique to deploy your code to pro...

I recently ran into a series of weird issues on my Acquia production environment which I traced back to some code I deployed which depended on my site being served securely using HTTPS.Acquia Staging environments don’t use HTTPS by default and req...

The process documented process for setting up a local environment and running tests locally is, in my opinion, so complex that it can be a barrier to even determined developers.For those wishing to locally test and develop core patches, I think it...

Getting around “Replace NewToner” on Dell E310DWThe Dell E310DW prevents you from printing if it thinks the toner is low. Of course, the toner is fine, it’s just planned obsolescence.There is a way around this: Go to http://dellfa608a.local./gene...

My school board, Marguerite-Bourgeoys, sent my wife and myself an email asking us to re-register our kids for the following year using Microsoft Mozaik software.A link is provided to the Microsoft Mozaik portal.My wife tried registering several ti...

Here are a few things I learned about caching for REST resources.There are probably better ways to accomplish this, but here is what works for me.Let’s say we have a REST resource that looks something like this in .../my_module/src/Plugin/rest/res...

I recently needed to port hundreds of Drupal 7 webforms with thousands of submissions from Drupal 7 to Drupal 8.My requirements were: Node ids need to remain the same Webforms need to be treated as data: they should be ignored by config export a...

Last week I wrote about setting up a reverse-proxy to serve a number any number of Docker containers via https.In order for this technique to work with Docker-Compose, we need to add a network to the Docker-Compose container.PremiseLet’s say you h...

This article is about serving your Drupal Docker container, and/or any other container, via https with a valid Let’s encrypt SSL certificate.Edit: if you’re having trouble with Docker-Compose, read this follow-up post.Step one: make sure you have ...

As the maintainer of Realistic Dummy Content, having procrastinated long and hard before releasing a Drupal 8 version, I decided to leave my (admittedly inelegant) logic intact and abstract away the Drupal 7 code, with the goal of plugging in Drup...

Unless you work exclusively with Drupal developers, you might be hearing some criticism of the Drupal community, among them: We are almost cult-like in our devotion to Drupal; maintenance and hosting are expensive; Drupal is really complicated;...

This technical post will run through how I went about migrating this site (the Dcycle blog) from Drupal to Jekyll. For the reasons why I migrated, please see Know when not to use Drupal.Exporting very simple content from Drupal to JekyllDepending ...

Docker is now available natively on Mac OS in addition to Linux. Docker is also included with CoreOS which you can run on remote Virtual Machines, or locally through Vagrant.Once you have installed Docker and Git, locally or remotely, you don’t ne...

I have seen many developers on a few teams cringe when they need to make a simple CSS change and are faced with this folder structure:myproject some-folder another-folder sass something.scss css something.cssIn my opini...

Gitflow is a development workflow we use where all features are developed on their own branch, and we constantly merge in the mainline (in this example it will be master) to the feature branches, until the feature branches are ready, at which poin...

I installed a script called test.php on a Vagrant box with CentOS 6.x and PHP 5.3. I made my script available at http://example.local/test.php and it contains:<?phpfunction whatever() { sleep(1);}while (TRUE) { whatever();}When I access this ...

You might get this error especially with very large projects. We are assuming that your setup is: Your local “bare metal” computer (can be any OS). CoreOS running on Vagrant and VirtualBox. Containers running via Docker on CoreOS.We are assumin...

PHPUnit tests, or Drupal simpletests, are sometimes used to make sure your functions calculating date and times work correctly.I recently had a failure on my continuous integration server where a year was one day more than it was supposed to be. O...

A few weeks ago, I participated in an online panel on the subject of Test-Driven Development as part of Continuous Discussions (#c9d9), a series of community panels about Agile, Continuous Delivery and DevOps. Watch a recording of the panel:Contin...

If you are using a site deployment module, and running simpletests against it in your continuous integration server using drush test-run, you might come across Simpletest output like this in your Jenkins console output:Starting test MyModuleTestCa...

To me, modern code must be tracked by a continuous integration server, and must have automated tests. Anything else is legacy code, even if it was rolled out this morning.In the last year, I have adopted a policy of never modifying any legacy code...

Continuous integration (CI) is the practice of running a series of checks on every push of your code, to make sure it is always in a potentially deployable state; and to make sure you are alerted as soon as possible if it is not.Continuous integra...

I recently added Docker support to Realistic Dummy Content, a project I maintain on Drupal.org. It is now possible (with Docker installed, preferably on a CoreOS VM) to run ./scripts/dev.sh directly from the project directory (use the latest dev v...

Here is a typical usecase: You master branch contains your code in a potentially deployable state You have a feature branch, with a bunch of commits. When your feature branch is ready, you want to merge it to master as a single commit.For examp...

To get the most of this blog post, please read and understand Getting Started with Docker (Servers for Hackers, 2014/03/20). Also, all the steps outlined here have been done on a Vagrant CoreOS virtual machine (VM).I recently needed a really simpl...

I have been using Simpletest on Drupal 7 for several years, and, used well, it can greatly enhance the quality of your code. I like to practice test-driven development: writing a failing test first, then run it multiple times, each time tweaking t...

When building a Drupal 7 site, one oft-used technique is to keep the entire Drupal root under git (for Drupal 8 sites, I favor having the Drupal root one level up).Starting a new project can be done by downloading an unversioned copy of D7, and in...

Gerrit is a free open-source code review platform created by Google. In this post we will develop code locally and review it in Gerrit.Step 1: install Gerrit and set up your git repo. Start by installing a Gerrit server at http://gerrit.example.c...

Gerrit is a free open-source code review platform created by Google. In this post we will set up Gerrit with a Git repo.Step 1: install GerritSee this post for instructions on how to install Gerrit on CentOS. We will assume that your Gerrit instan...

What is content? What is configuration? At first glance, the question seems simple, almost quaint, the kind one finds oneself patiently answering for the benefit of Drupal novices: content is usually information like nodes and taxonomy terms, whil...

Phabricator is a free open-source code review and workflow management system. Here is how it can be used to track a git repo.Step 1: install PhabricatorIf you are just evaluating Phabricator you can use these instructions to set up an evaluation v...

Phabricator is a free open-source code review and workflow management system. Here is how it can be integrated into a code-review workflow.Step 1: install Phabricator and make it track a git repo If you are just evaluating Phabricator you can use...

Gerrit is a free open-source code review platform created by Google. Here is how to set up a quick, insecure version of Gerrit for evaluation.You might also be interested in Phabricator (installing, linking with git, and reviewing code), another p...

Phabricator is a free open-source code review and workflow management system. Here is how to quickly install Phabricator in a manner which should be considered non-secure, so you can determine if it is right for you. You might also be interested i...

What is code-driven development and why is it done?Code-driven development is the practice of placing all development in code. How can development not be in code?, you ask.In Drupal, what makes your site unique is often configuration which resides...

I had this checklist documented internally, but I keep referring back to it so I’ll make it available here in case anyone else needs it. The idea here is to document a minimum (not an ideal) set of modules and tasks which I do for almost all proje...

One of the techniques I use to make sure I write tests is to write them before I do anything else, which is known as test-driven development. If you develop your functionality before writing a test, in most cases you will never write the test to g...

Many Drupal projects now under maintenance suffer from technical debt: a lot of the functionality is in the database and outside of git, and the code lacks automated testing. Furthermore, the functionality is often brittle: a change to one feature...

For your Jenkins job to connect to Git, you need two things: An ssh key on your jenkins account The Jenkins user needs to have a public private key pair. To do this you need to log into your command line as the jenkins user. Here is how. Use...

Drupal uses incremental IDs for such data as taxonomy terms and nodes, but not content types or vocabularies. If, like me, you believe your site’s codebase should work with different environments and different databases, your incremental IDs can b...

It is generally agreed that cloning the database downstream (that is, from development toward production) is a bad idea, if only because by doing so all production content is lost; most developers use Features, Context, some variation on a site de...

Edit (2016-10-03): This website is no longer Drupal-based.Deployments are often one of the most pain-inducing aspects of the Drupal development cycle. I have talked to Drupal developers in several shops, and have found that best practices are ofte...

In a Drupal development-staging-production workflow, the best practice is for new features and bug fixes to be developed locally, then moved downstream to the staging environment, and later to production.Just how changes are pushed downstream vari...

I recently inherited a Drupal project which periodically imported content from a Nuxeo server, synchronizing it with Drupal nodes, thus creating, updating and deleting nodes as need be. Nuxeo content was in no case modified by Drupal.The Nuxeo ser...

Let’s say you are working locally and you need to add a new module to the site. Here is an example with Login Toboggan:Let’s start by downloading the module to our local dev sitedrush dl logintobogganInstead of enabling it outright, we’ll want to ...

Examples like these are rampant throughout Drupal 7, in block_admin_display_form_submit(), for example:/** * Form submission handler for block_admin_display_form(). * * @see block_admin_display_form() */function block_admin_display_form_submit($fo...

Sometime one needs to clone an entire remote website in order to diagnose certain problems. Here’s how I go about it:The following example assumes that: You have a local webserver, in this example MAMP. You have Drush installed both locally and ...