Blog Archives

Make a Field Label “visually-hidden” in Drupal 8

Using the Form API you can add a visually-hidden class to a field using the “#title_display” property as shown here:

 

Tagged with: ,
Posted in Development

Drupal 8 Search API Tips

Here are some quick tips for configuring Search API for Drupal 8. Easy Indexing If you’re like me you rely heavily on Display Modes (aka View Modes) for your entity types. The most convenient way to get Search API to index

Tagged with: , , ,
Posted in Development

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. If you come up with a solution for this please

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