Check your version

This video covers a topic in Drupal 7 which may or may not be the version you're using. We're keeping this tutorial online as a courtesy to users of Drupal 7, but we consider it archived.

Alternate resources: 

An overview of the Devel module

Video loading...

Join Drupalize.Me to watch this video

Join today and gain instant access to our entire video library.

Log in Sign up
  • 0:07
    In this chapter, we're going to take a look at some of the tools
  • 0:10
    that are available to us as module developers
  • 0:13
    that just help make our lives a little bit easier.
  • 0:16
    We'll start off by taking a look at a module named Devel.
  • 0:19
    We can see that Devel is a suite of modules containing fun
  • 0:23
    for module developers and themers.
  • 0:25
    It does have some fun in it, but really,
  • 0:27
    it's got a lot of helpful functions in it
  • 0:29
    and tools that are going to make our job a little bit easier.
  • 0:32
    In addition to that main set of helper functions

An Overview of the Devel Module


This video walks through the handy devel module from and demonstrates the tools it provides for debugging, inspecting and analyzing the code and SQL queries happening on your site. In this video you'll also learn about some of the helper functions built into the devel module that make it simpler to inspect the large nested arrays that you'll commonly come across when writing code for Drupal.

You may not have heard of the function dsm() before now. It is a legacy function and dpm() is the newer name. The two functions are identical since dsm() is just a wrapper for dpm().
The idea is that dsm() was a poor name for the function, it's short for drupal set message, but what was later decided that drupal print (as in print_r) message was better.

The difference between those two and kpr() is that dpm() does a permissions check to make sure the current user has permission to view devel's output, and then puts the krumo'd variable dump into the message queue via drupal_set_message(). This means that dpm() will work and let you see the output even if you're redirected. Great for debugging forms. kpr() just krumo's and dumps the value right here, right now. No permission check, no regard for where the content is being spit out.

Additional resources:
There are no resources for this video. If you believe there should be, please contact us.