Recipe 72: Debugging
In this special set of recipe notes we look at a variety of ways to determine what's in a variable such as $node
. This proved vital information to help determine the name for the $links['simplefeed_item_parent']
array element, for instance, above. We do not have to divine this information!
Experiment with as many of the approaches as suit your fancy. You are sure to develop some favorite functions in the mix (the author's three favorites are dpr()
—which requires the Devel module, mail()
—when it's helpful to have a separate window for viewing the variable contents, and the Drupal For Firebug module).
The following debugging statements can be placed directly in the module code in Recipe 71, replacing the lines with the pound signs. They can also be widely used in modules and template files throughout Drupal. The statements are appropriate for use in development servers, rather than live sites.
These debugging statements...