diff --git a/devel.module b/devel.module index 2444e1a..36b37e1 100644 --- a/devel.module +++ b/devel.module @@ -1561,6 +1561,8 @@ function dargs($always = TRUE) { * Whether to return or print the string. Default to FALSE. * @param $name * Optional name for identifying the output. + * @return + * The query object, or the query string if $return was TRUE. */ function dpq($query, $return = FALSE, $name = NULL) { if (user_access('access devel information')) { @@ -1576,34 +1578,50 @@ function dpq($query, $return = FALSE, $name = NULL) { return $sql; } else { - dpm($sql, $name); + return dpm($sql, $name); } } } /** - * Print a variable to the 'message' area of the page. Uses drupal_set_message() + * Print a variable to the 'message' area of the page. Uses drupal_set_message(). + * + * @param $input + * An arbitrary value to output. + * @param $name + * Optional name for identifying the output. + * @return + * The unaltered input value. */ function dpm($input, $name = NULL) { if (user_access('access devel information')) { $export = kprint_r($input, TRUE, $name); drupal_set_message($export); } + return $input; } /** - * drupal_var_export() a variable to the 'message' area of the page. Uses drupal_set_message() + * drupal_var_export() a variable to the 'message' area of the page. Uses drupal_set_message(). + * + * @param $input + * An arbitrary value to output. + * @param $name + * Optional name for identifying the output. + * @return + * The unaltered input value. */ function dvm($input, $name = NULL) { if (user_access('access devel information')) { $export = dprint_r($input, TRUE, $name, 'drupal_var_export', FALSE); drupal_set_message($export); } + return $input; } // legacy function that was poorly named. use dpm() instead, since the 'p' maps to 'print_r' function dsm($input, $name = NULL) { - dpm($input, $name); + return dpm($input, $name); } /**