Posted by Daniel Norton on June 21, 2009 at 7:56pm
Jump to:
| Project: | Devel |
| Version: | 6.x-1.6 |
| Component: | devel |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | krumo |
Issue Summary
Calling kprint_r() only dumps the structure and ignores the name parameter when using krumo.
This patch outputs the name using dprint_r() before calling krumo().
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| devel.module.patch | 580 bytes | Ignored: Check issue status. | None | None |
Comments
#1
looked at the patch and it seems a bit more complex than what i expected. can it be simplified?
#2
#3
This bothers me, too. Can't we just change
<?phpreturn $return ? krumo_ob($input) : krumo($input);
?>
to
<?phpreturn $return ? (isset($name) ? $name .' => ' : '') . krumo_ob($input) : krumo($input);
?>
?
#4
looks fine to me. you may commit this, salvis. my checkout is in flux right now.
#5
Committed to all three versions, thanks.
While looking at the D5 version I found this:
<?phpfunction kprint_r($input, $return = FALSE, $name = NULL, $function = 'print_r') {
if (has_krumo()) {
if (user_access('access devel information')) {
return $return ? (isset($name) ? $name .' => ' : '') . krumo_ob($input) : krumo($input);
}
}
else {
return dprint_r($input, $return, $name, 'print_r');
}
}
?>
'print_r'at the bottom is hard-coded rather than using$function. This is unchanged from the original patch that introduced the function in #232570: Krumo Devel 5.x backport. It was fixed for D6 in #260197: Typo in kprint_r, but not for D5. Shall I fix it?#6
Sure, fix for d5. you can do whatever you want with that branch. its dead to me :)
#7
Ok, done. :)
#8
Automatically closed -- issue fixed for 2 weeks with no activity.