Skip to main content

📘 Understanding Drupal: A Complete Guide to Caching Layers — my new book is out now!

[2018-10-12]

Running Drupal's PHPUnit test suites on DDEV

#ddev #drupal #phpunit #testing

DDEV is a local development stack built on top of Docker. It gives you all of your environment needs without messy configured on your host machine, without needing to know Docker or configure your own containers. Which is great, and makes life easier. Instead of just using DDEV to develop your site or application locally, why not also run your tests within it?

[2018-10-10]

OK PhpStorm, what methods does my entity have?

#drupal #phpstorm

Working in object-oriented programming is great. You can define interfaces which specify a contract that implementers need to fulfill. You can then extend these to define your end requirement and provide the implementation. This also means you can guarantee an object that implements that interface will have a guaranteed set of known methods.

[2018-10-07]

I am looking to try something new on my site, adding a way to just provide quick updates. Possibly experimenting with it being my way to publish to social networks.

[2018-10-06]

Test driven development in PhpStorm with auto-testing enabled

#phpunit #testing #test-driven development #phpstorm #drupal
When I work, I try to follow the principles of Test-Driven Development. I have found it to aid me in writing cleaner code, identifying odd coupling of components or crazy accidental dependencies between components. It also lets me write my API first by using mocks against interfaces I have defined. PhpStorm's auto-test functionality speeds up my test-driven development process.
[2018-09-27]

Tracking changes in Migrate with dynamic row hashes

#drupal #migrate

When it comes to Drupal and external data, I use Migrate. A lot. Like a lot, lot, lot. Many times this data is being imported over CSV files that are pushed to a server at some defined interval. Usually, the data can be derived directly from the CSV file itself, other times a custom process plugin derives data from other information.

[2018-09-24]

Xdebug over the command line with DDEV

#ddev #drupal #xdebug

I moved over to DDEV for my local development stack back in February. One of my favorite things is the ease of using Xdebug.

[2018-09-21]

Using multiple Solr cores with DDEV

#drupal #search api #ddev #solr

If you want to have multiple Solr indexes using Search API, you need to have a core for each index instance. For my local development stack, I use DDEV.

[2018-09-20]

Goodbye AdSense, hello CodeFund.

For a long time, I have had Google AdSense on my website. It generated enough revenue that I could hit the minimum payout of $100 about once a year, covering my hosting costs. Then, a few months ago, I found CodeFund by Gitcoin.

[2018-07-06]

Filtering out invalid entity references in Drupal 8

#drupal
Today I was working on a custom Drupal 8 form where I needed an option to purge existing entities and their references on a parent entity before running an import. It seemed pretty straightforward until I saw "ghost" values persisting on the parent entity's inline entity form. Here's my journey down the rabbit hole to fix broken entity reference values.