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

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