Presentation is loading. Please wait.

Presentation is loading. Please wait.

Http://www.flickr.com/photos/hhoyer/2859038799/.

Similar presentations


Presentation on theme: "Http://www.flickr.com/photos/hhoyer/2859038799/."— Presentation transcript:

1

2 minimalmedia.com/debugging-drupal
DrupalCamp Ohio December 13, 2013 David Trainer Minimal Media @minimalmedia minimalmedia.com/debugging-drupal

3 What's Debugging?

4 What we won't cover Interactive debugging and profiling tools like Xdebug, NetBeans, xhprof xdebug.org github.com/facebook/xhprof They are too platform-specific

5 Who does debugging? Not just developers Not just code Not just errors
Anyone who ever needs to dig into the system to figure out how something works Sometimes requires teamwork Debugging doesn't necessarily mean development You don't need to be writing code in order to experience a need to dig into the system and figure out how stuff works Any situation where the expected behavior doesn't match the expected behavior Importance of reproducing/replicating the issue: Sales/PMs take note: You can't really start debugging until you can reproduce the problem Should end with “The result was x, when I expected to see y”

6 When do we need to do debugging?
When the behavior of a system does not match the expected behavior Need complete knowledge of both, in order to study the gap between them What if you're not the one encountering the behavior?

7 “It's not coming up”

8 “It's not coming up”

9 “It's not coming up”

10 “It's not coming up”

11 Reproducibility Need a good description of the steps to reproduce
Test by inducing the problem behavior, while observing conditions inside the system On a complex issue, you can't start debugging until you can reproduce it

12 How to think What's Debugging?
1. Gather information 2. Form a hypothesis; devise a test 3. Test 4. goto 1 What's Debugging?

13 Gather Information

14 Tools and Resources api.drupal.org Chrome Developer tools, Firebug
Drush Devel devel_demo Coder curl find

15 Logging Understand how different parts of the system report problems
PHP Logging php.ini display_errors log_errors error_log Drupal dblog Syslog /var/log/syslog YMMV Understand how different parts of the system report problems

16 Understand how different pieces of the architecture fit together
Instrumentation Understanding what Drupal actually does when it builds a page Bootstrap Menu callback Examine response headers using Chrome and curl Understand how different pieces of the architecture fit together

17 Know how to use the tools to reveal what's going on inside
Instrumentation Understanding node hooks Using dpm() you can peer inside the node object during every phase You can use dpm() in the theme layer too ddebug_backtrace() Hack drupal_set_message() Know how to use the tools to reveal what's going on inside

18 Strategies Be prepared Dev environment Access to live environment
Tools necessary to create an entire copy of your site, quickly Divide and conquer, process of elimination Turn off your theme Turn off modules

19 Common Problems WSOD: http://drupal.org/node/158043 Caching
Reverse proxy cache Page cache Block cache Permissions Look out for field permissions Cron Performance related Make a list

20 Uncommon Problems Teaser trimming Menu cache

21 Thanks Robert Ristroph and-lamp/index.html Angie Byron Randy Fay Morten Wulff

22 minimalmedia.com/debugging-drupal
Q&A @minimalmedia minimalmedia.com/debugging-drupal


Download ppt "Http://www.flickr.com/photos/hhoyer/2859038799/."

Similar presentations


Ads by Google