Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By ETamsberg on
What has everyone found is the best way to debug a module? I typically will try to print_r and vardump something if I need to.
The reason I ask is that I am currently writing a module that adds new settings to fields of a particular entity type and my usual vardump or print_r strategy isn't serving me all that well.....
Any suggestions?
Thanks in advance for all your help!!
Comments
A lot of people use the dmp()
A lot of people use the dmp() [Edit: that should be dpm()] function that comes with the Devel module.
You can also use PHP debuggers, or XHProf.
But really, without specifics of what you are debugging, it's pretty hard to give any specific method of debugging.
Using these Hooks:
Trying to use the hook_field_info_alter() hook and the hook_form_field_ui_field_edit_form_alter() to add new settings to text field UI for a specific entity type.
Got the idea from the thread at the bottom of this page - https://api.drupal.org/api/drupal/modules!field_ui!field_ui.api.php/func...
I believe is dpm() not dmp()
I believe is dpm() not dmp() but i know you just mistyped it..
You're right. I edited the
You're right. I edited the original post.
Thanks for the help!
Thank you for the advice!
I have used the Devel module before myself and typically use a lot of dprint_r() but I was interested to hear what other people might also do to debug a module.
Thanks again for the input!!
Need multiple ways to debug drupal code
Can some one elaborate all possible ways and scenarios what debug tools can be used?