Creating a contact form programmatically in Drupal 8

Drupal 8's expanded and broadly-used Entity API extends even to Contact Forms, and recently I needed to create a contact form programmatically as part of Honeypot's test suite. Normally, you can export a contact form as part of your site configuration, then when it's imported in a different site/environment, it will be set up simply and easily.

However, if you need to create a contact form programmatically (in code, dynamically), it's a rather simple affair:

First


Midwestern Mac's Vagrant Boxes - CentOS and Ubuntu

In support of my mission to make local development easier and faster, I've released boxes for four of the most popular Linux distributions I use and see used for Drupal sites: CentOS 6/7 and Ubuntu 12.04/14.04.

Vagrant Boxes - Midwestern Mac, LLC

I've been using other base boxes in the past, but it's hard to find updated boxes (especially for newer OSes) from people or companies you can trust that are truly minimal base boxes (e.g. no extra


Sync a Shared Google Calendar with macOS, OS X, iOS (iPhone, iPad), or CalDav

2018 Update : Sadly, this is still the correct way to get syncing working.
2019 Update : Still true.
2020 Update : Sigh.
2021 Update : Yup, still relevant.
2022 Update : Another year, still relevant.
2023 Update : Still works
2024 Update : How is it possible Google still hasn't fixed this?

Someone shared a Google Calendar with me recently, and it showed up at calendar


Preventing yourself from accidentally breaking production with Drush

For all the sites I maintain, I have at least a local and production environment. Some projects warrant a dev, qa, etc. as well, but for the purposes of this post, let's just assume you often run drush commands on local or development environments during development, and eventually run a similar command on production during a deployment.

What happens if, at some point, you are churning through some Drush commands, using aliases (e.g. drush @site.local break-all-


How to set complex string variables with Drush vset

I recently ran into an issue where drush vset was not setting a string variable (in this case, a time period that would be used in strtotime() ) correctly:

# Didn't work:$ drush vset custom_past_time '-1 day'Unknown options: --0, --w, --e, --k.  See `drush help variable-set`      [error]for available options. To suppress this error, add the option--strict=0

#vBrownBag DevOps presentation - Oct 29 [Updated]

In the middle of preparations for next month's Souls & Goals soccer match, I've also been very busy with Ansible-related activities.

I'm still making progress in writing Ansible for DevOps (over 45,000 words, and over 900 people have already bought the book on LeanPub!), and I've been invited by the folks at Professional VMWare to present in their #vBrownBag DevOps Series ! I'll be talking about Ansible for an hour or so,


Resizing a VirtualBox Disk Image (.vmdk) on a Mac

Every now and then, a project I'm managing through Vagrant (using either a box I built myself using Packer, or one of the many freely available Vagrant Boxes ) needs more than the 8-12 GB that's configured for the disk image by default. Often, you can find ways around increasing the disk image size (like proxying file storage, mounting a shared folder, etc.), but sometimes it's just easier to expand the disk image.

Unfortunately, VBoxManage's modifyvm


Fixing Drupal Fast - Using Ansible to deploy a security update on many sites

Earlier today, the Drupal Security Team announced SA-CORE-2014-005 - Drupal core - SQL injection , a 'Highly Critical' bug in Drupal 7 core that could result in SQL injection, leading to a whole host of other problems.

While not a regular occurrence, this kind of vulnerability is disclosed from time to time—if not in Drupal core, in some popular contributed module, or in some package you have running on your Internet-connected servers. What'


St. Louis Drupal Group - Hackathon on Headless Drupal 8 & AngularJS

Now that Drupal 8.0.0-beta1 is out, and the headless Drupal craze is in full-swing, the Drupal St. Louis meetup this month will focus on using Drupal 8 with AngularJS to build a demo pizza ordering app. (The meetup is on Thurs. Oct. 23, starting at 6:30 p.m.; see even more info in this Zero to Drupal post).

We'll be hacking away and seeing how far we can get, and hopefully


Writing on LeanPub - $0.21 per word

I've been blogging for 10 years, and I've written over 800,000 words in posts. As time progresses, I try to clearly convey more information with fewer words. It's been hard to quantify the value derived from those words, however, since the only measurements I could make (e.g. a small amount of ad revenue) have been subjective at best.

For almost seven months, I've been writing Ansible for DevOps , publishing on LeanPub