HomeWebsite StrategySearch Krumo–Seconds (if not Minutes) Off your Day

Search Krumo–Seconds (if not Minutes) Off your Day

In this post I’m assuming you’ve used the Drupal Devel module and Krumo to inspect or debug your arrays using dpm() in a more user-friendly manner than printr() or vardump().

If you have not used Devel and regularly debug Drupal arrays, stop everything you’re doing and check it out. The Search Krumo module adds a search field to Krumo which allows you to enter a key or value and then tells you how many times that value is contained in the array and also opens the applicable keys and highlights the value you are looking for.

Once you have found the value you are looking for Search Krumo lets you copy the path, which is a nice time saver for arrays with many keys. However when using dpm(), be sure to notice that the variable you are inspecting is replaced by $var in the copied path. So if you dpm($vars[‘node’]) or dpm($form), Search Krumo will convert that variable to $var in the copied path. This can be easily overcome by using sdpm() instead of dpm().

This is a simple module to get up and going. There is no configuration needed, and everything you need to know to get started is covered on the Search Krumo project page. All in all this module is a great time saver, and one I welcome into my workflow.

My Google+ Account