Blog Archives

Manually Checking Path-based Visibility in Drupal 8

This mimics the path visibility settings on block configurations.

 

Tagged with: ,
Posted in Development

Block Caching “Gotcha” in Drupal 8

I recently had a fight with the Block system in Drupal 8. To be brief, if you’re trying to disable caching on a block, make sure to set the #cache element regardless of whether the block has output or not.

Tagged with: , ,
Posted in Development

Send email after Migrate Import in Drupal 8

Here’s an example of a barebones event subscriber to send an email when a Drupal migration finishes importing. The success vs failure logic isn’t working correctly, but you’ll get the gist. The file structure looks like this: mymodule.services.yml

Tagged with: , , ,
Posted in Development

Setting up xdebug for PHP 7 in Acquia DevDesktop

The Acquia DevDesktop help page says: The PHP 7 version currently included with Acquia Dev Desktop does not currently include Xdebug. You can download an updated version of Xdebug here . Here are the actual steps I used. YMMV.

 

Tagged with: , , ,
Posted in Development

Drupal 8 Migrate Process Plugin: migration_lookup_target_ids

I was having some difficulties using the migration_lookup process plugin. I wrote this plugin so that I could make sense of how the migration lookup was working and the data that it was returning. The plugin ended up being something

Tagged with: , ,
Posted in Development

Drupal 8 Migrate – Tips and Tricks

This is an ongoing brain dump of quick tips for working with Drupal 8 Migrate. These items may seem true to me as I’m writing them today, but I’m constantly being reminded that things aren’t always as they seem with Migrate.

Tagged with: , ,
Posted in Development

Extending the Migrate Plus JSON Parser in Drupal 8

The migrate_plus module provides a great JSON parser for easy migration of JSON data. With a small amount of code in a new class you can tweak the parser a bit. In my case I wanted to make a few simple

Tagged with: , ,
Posted in Development

Monitoring a Drupal 8 Migration Executed with Drush

Update 2 is proving to be the most useful method. Update 1 Somehow I missed the documentation regarding the --feedback  argument for the drush mi  command. It’s similar to the methods below in that it helps you see that the migration is

Tagged with: , , ,
Posted in Development

Alter Date Format in a Drupal 8 Migration

Per https://www.drupal.org/node/2820490 you can now use the format_date plugin to alter date formats like this:

I do always recommend using skip_on_empty before any other process plugins.

Tagged with: , ,
Posted in Development

Drupal Views – Show One (Most Recent) Item Per Group

Alright, the title is a bit misleading because I’m not using Groups, but it is the best explanation of what I’m achieving with this example. My goal is to show a list of the most recent blog post in each category, where

Tagged with: , , ,
Posted in Development