EECI 2011 Workshop: Debugging EE

38
ERIKREAGAN•EECI DEBUGGINGEE SITEPROBLEMS

description

These slides are from the workshop during Dev Day at EECI 2011. They contain some tips primarily centered around the following article: http://focuslabllc.com/blog/troubleshooting-expressionengineDuring the workshop I demoed each "problem -> solution" so some context is lost with the standalone slides.

Transcript of EECI 2011 Workshop: Debugging EE

Page 1: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

DEBUGGING!EESITE!PROBLEMS

Page 2: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

WHO!IS!THIS!GUY?

2

Partner & Lead Developer

Page 3: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

FORMATSample problem Debugging process

3

Page 4: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

STEP!"#!QUESTIONS• Verbally speak the problem

• Have you seen this problem in the past?

• Have you read about or hear someone talk about this problem?

4

Page 5: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

STEP!"#!QUESTIONS

• What are the symptoms?

• I have incorrect content displaying

• No content is displaying

• My template not rendering as expected

• All URLs show my site’s home page

• I see the “white page of death” on certain pages

5

Page 6: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

STEP!$#!CONFIRMATION• “Is it plugged in”

• Clear your cache

• Try multiple browsers / computers if necessary

• Log in as the user who experienced the problem

6

Page 7: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

STEP!$#!CONFIRMATION

• Based on the symptom(s), what do we know about the problem in the past?

• Log debugging issues for future use and refer to them later.

7

Page 8: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

STEP!%#!MAKE!CHANGES• Begin to change things to find the source of the

problem

• Template code

• Channel Entry (or related module) data

• System setting changes

8

Page 9: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

SAMPLE!PROBLEMS

9

Page 10: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!"Verbal review of the problem:

I have the 10 most recent “News” entries on my sidebar, but they don’t show up on some pages.

10

Page 11: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!"#!THE!QUESTIONS

Have you seen this problem in the past?

(If you’re Lisa Wess you probably have dreams (nightmares?)about this problem, they’re so common.)

• If so, what was the solution to that problem?

• If not, it’s time to start making changes.

11

Page 12: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!"#!THE!SOLUTION

Add dynamic=”no” to the {exp:channel:entries} loop parameters so the URL doesn’t determine what results are returned in the sidebar.

12

Page 13: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!$Verbal review of the problem:

I’m making changes to my template flat file, but they aren’t appearing on the website.

13

Page 14: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%14

PROBLEM!$#!THE!QUESTIONS

Have you seen this problem in the past?

• If so, what was the solution to that problem?

• If not, it’s time to start making changes.

Page 15: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%15

PROBLEM!$#!CONFIRMATION

• Check database details

• Clear the cache

• Try updating a different template (narrow the search)

Page 16: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%16

PROBLEM!$#!THE!CHANGES

• We have unexpected template / display output

• Start with enabling the template debugging option

• What is different between templates that work, and the one that does not?

• Goes back to your experience and what you remember or have logged about previous problems

Page 17: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!$#!THE!SOLUTION

The template that wasn’t showing changes was flagged in the database to not be saved as a flat file and thus our changes were not being displayed.

Switching the template to be saved as a flat file fixes the problem.

17

Page 18: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!%Verbal review of the problem:

My channel:entries loop isn’t returning the expected number of results.

18

Page 19: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%19

PROBLEM!%#!THE!QUESTIONS

Have you seen this problem in the past?

• If so, what was the solution to that problem?

• If not, it’s time to start making changes.

Page 20: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%20

PROBLEM!%#!CONFIRMATION

• Check number of results with CP filter (if possible)

• Clear the cache

Page 21: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%21

PROBLEM!%#!THE!CHANGES

• Review the query being executed

• Manually run the query yourself if needed

• Update the channel:entries parameters to modify the query being executed

Page 22: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!%#!THE!SOLUTION

ExpressionEngine defaults to limiting Channel Entry loops to 100 results for performance reasons.

Because we want over 100 results returned in a single loop we had to add a limit=”x” parameter to the tag.

22

Page 23: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!&Verbal review of the problem:

My entire site is nothing but a “white page of death.” I can log in to the CP, but the front-end isn’t displaying.

23

Page 24: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%24

PROBLEM!&#!THE!QUESTIONS

Have you seen this problem in the past?

• If so, what was the solution to that problem?

• If not, it’s time to start making changes.

Page 25: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%25

PROBLEM!&#!CONFIRMATION

• Make sure it’s not just a single template

• Clear the cache

• Review any recent repository changes

• Recall any recent database changes

Page 26: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%26

PROBLEM!&#!THE!CHANGES

• Enable all debugging

• Template debugging

• Output profiler

• Debug setting in EE

• $debug variable in index.php

Page 27: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!&#!THE!SOLUTION

A newly implemented plugin, CI Helpers, had a bug in its plugin file.

Turning on our debug settings allowed us to see the PHP error and fix the problem.

27

Page 28: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!'Verbal review of the problem:

My entire site is nothing but a “white page of death.” This time it’s even the control panel. I can’t access the CP to turn on any debug settings or see what’s wrong.

28

Page 29: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%29

PROBLEM!'#!THE!QUESTIONS

Have you seen this problem in the past?

• If so, what was the solution to that problem?

• If not, it’s time to start making changes.

Page 30: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%30

PROBLEM!'#!CONFIRMATION

• Review any recent repository changes

• Recall any recent database changes

Page 31: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%31

PROBLEM!'#!THE!CHANGES

• Disable extensions to see if that helps

• Enable all debugging in your config file

• Template debugging

• Output profiler

• Debug setting in EE

• $debug variable in index.php

Page 32: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

PROBLEM!'#!THE!SOLUTION

A newly implemented extension had a bug in the code.

Disabling extensions allowed us to determine it was an extension causing the problem. Turning on our debug settings allowed us to see the PHP error and fix the problem.

32

Page 33: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

QUESTIONS• Verbally speak the problem

• Have you seen this problem in the past?

• Have you read about or hear someone talk about this problem?

• What are the symptoms?

33

Page 34: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

NON(EE!TIPS• .htaccess

• print_r()

• var_dump()

• debug_backtrace()

• Xdebug for PHP

34

Page 35: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

GETTING!HELP• Seek help on EE forums or 3rd party support channel

• Ask on twitter (with the #eecms hash, of course)

• Consider sites like Stack Overflow for general PHP or server issues

35

Page 36: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

WHAT!NOT!TO!DO• Bug the first person you see on AIM/Skype/gTalk

without trying things yourself

• Complain on the EE forums without troubleshooting yourself

• Complain on a 3rd party dev's forums without troubleshooting yourself

• Complain on twitter

36

Page 37: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%37

focuslabllc.com/blog/troubleshooting-expressionengine

Page 38: EECI 2011 Workshop: Debugging EE

!ERIKREAGAN"""•"""EECI"#$%%

THANKS!@ErikReagan

38