Persistent Field Storage in Drupal 8

While working on the Drupal 8 module, I discovered this option to keep field storage persistent.

By default a field storage is removed when it’s no longer used. This happens when you simply delete fields. If all the fields that use the storage have been deleted, then the field storage is no longer needed and it’s removed.

Continue reading “Persistent Field Storage in Drupal 8”

How to Print Variables using Kint in Drupal 8

When you start tinkering with a module or a theme in Drupal, eventually you’ll need to print a variable to see what’s inside.

Now in PHP you have var_dump and print_r but these functions aren’t the easiest to work with. When used they print the variable fully expanded, making it hard to filter or find anything.

In the Devel module for Drupal 7, you have the dpm and dsm which printed variables using the Krumo library. For Drupal 8, however, this library has been replaced with a more modern and maintained library called Kint.

In the latest tutorial over at WebWash, learn how to print variables within Php and the Twig template using Kint.

Link: How to Print Variables using Kint in Drupal 8

How to Get Split View working in OS X El Capitan after Upgrade

I recently upgraded from Yosemite to El Capitan but I couldn’t get the Split View functionality to work.

For people who don’t know, the Split View lets you run two apps side by side.

Split View
Split View example.

Get Split View Working

To get it working, just go to “System Preferences” -> “Mission Control” and check the “Displays have separate Spaces”. You’ll have to logout and log back in for it to work.

Mission Control
Check “Displays have separate Spaces” checkbox to get Split View working.

Now you’ll be able to run two apps side by side. Enjoy the extra bit of productivity, or use it to watch YouTube videos. I won’t judge.

Get Performance Insights Using Web Profiler in Drupal 8

Web Profiler, which ships with Devel, adds a toolbar at the bottom of each page and gives you stats about your Drupal site. Out-of-the-box, you get the number of queries, how much memory was used and so much more.

Web Profiler Tool
Web Profiler toolbar default items.

Learn how to get the most out of it by watching the video above or head over to the link below.

Link: Debug Site Performance Using Web Profiler in Drupal 8