what to do when things go wrong with drupal
Post on 20-Oct-2014
1.995 views
DESCRIPTION
Slides from Damien McKenna's session "What to do when things go wrong with Drupal" from Drupalcamp Atlanta 2012.TRANSCRIPT
![Page 1: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/1.jpg)
What to do when things go wrong.
(because it will)
![Page 2: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/2.jpg)
.. withCODE!
![Page 3: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/3.jpg)
.. andFreddie Mercury!
![Page 4: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/4.jpg)
Damien McKennaLead Drupal Architect
@DamienMcKennadrupal.org/user/108450
![Page 5: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/5.jpg)
“Freddie Mercury”Farrokh Bulsara
Lead vocalsQueen
![Page 6: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/6.jpg)
DRUPAL, DAY 1
![Page 7: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/7.jpg)
Building with Drupal
• Starting off..• Lots of trepidation• Infamous learning curve• Lots of reading – books, blogs, tutorials..• Lots of screencasts!
![Page 8: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/8.jpg)
Building with Drupal
• Add Views & other modules• Add a little theming• Go a long way!
![Page 9: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/9.jpg)
Building more with Drupal
• Start feeling comfortable• Add some more modules• Build lots of sites!
![Page 10: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/10.jpg)
\o/
“We Are The Champions”“News of the World” (1977)
![Page 11: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/11.jpg)
Continuing on..
• Install a module
• Awesome!
![Page 12: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/12.jpg)
But then..
Notice: Undefined index: option in theme_select_or_other_none() (line 249 of /sites/all/modules/contrib/select_or_other/select_or_other.module).
• Whaaa?
![Page 13: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/13.jpg)
Eek!
• Line 249:
• Whaaaaaaaaaaaaaaaa?
![Page 14: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/14.jpg)
That moment..
“Going Slightly Mad”“Innuendo” (1977)
![Page 15: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/15.jpg)
Drupalburp, noun;
• A bug.• A small bug.• It’s still a bug.• There are lots of them.
![Page 16: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/16.jpg)
Step 1: Search issue queue
![Page 17: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/17.jpg)
Step 1: Results
![Page 18: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/18.jpg)
Step 1: Review
![Page 19: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/19.jpg)
Step 2: Create a new issue!
![Page 20: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/20.jpg)
Step 2: Create a new issue..
![Page 21: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/21.jpg)
Step 2: Issue created!
![Page 22: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/22.jpg)
TIME TO DEBUG!
![Page 23: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/23.jpg)
Development Tips
1. drupal_set_message()
![Page 24: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/24.jpg)
Whaaaa?
![Page 25: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/25.jpg)
Development Tips
1. drupal_set_message()2. debug()
![Page 26: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/26.jpg)
debug() output
![Page 27: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/27.jpg)
Development Tips
1. drupal_set_message()2. debug()3. Devel module4. dpm()
![Page 28: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/28.jpg)
dpm()
![Page 29: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/29.jpg)
dpm() output
![Page 30: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/30.jpg)
dpm() output awesomesauce!
![Page 31: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/31.jpg)
Reviewing the error
• “Undefined index”• Means that an array element doesn’t exist.• I can fix that!
![Page 32: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/32.jpg)
Original code
![Page 33: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/33.jpg)
The fix
![Page 34: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/34.jpg)
It works!
• Time to share the joy!
![Page 35: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/35.jpg)
Get the code
![Page 36: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/36.jpg)
Getting the code
![Page 37: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/37.jpg)
Clone it!
![Page 38: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/38.jpg)
Fix it!
![Page 39: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/39.jpg)
Diff it!
![Page 40: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/40.jpg)
Diff it!
![Page 41: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/41.jpg)
Patch it!
![Page 42: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/42.jpg)
Name it!
• Patch naming: project name & issue number.• [project]-n[issue]-[comment#].patch• [project]-n[issue]-[comment#]-
[message].patch– drupal-n1067120-145-d7.patch– metatag-n1820374.patch– views-n1809862-7.patch
![Page 43: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/43.jpg)
Upload it!
![Page 44: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/44.jpg)
And then..
![Page 45: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/45.jpg)
Wait.
• Maintainers can take time to respond.• People live busy lives.– Drupal 8’s “development babies” list :-)
• Other modules or core work may take a higher priority.
• Don’t give up if little or no response.
![Page 46: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/46.jpg)
Development Tips
1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!
![Page 47: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/47.jpg)
PATCHES.txt
![Page 48: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/48.jpg)
Development Tips
1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!6. kpr() and exit()
![Page 49: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/49.jpg)
kpr()
![Page 50: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/50.jpg)
Development Tips
1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!6. kpr() and exit()7. xdebug – hardcore debugging!• .. and IDE debugger or MacGDBp
![Page 51: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/51.jpg)
MacGDBp
![Page 52: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/52.jpg)
Development Tips
1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!6. kpr() and exit()7. xdebug – hardcore debugging!• .. and IDE debugger or MacGDBp
8. Let modules die!
![Page 53: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/53.jpg)
Redundant: see redundant
“Who Wants to Live Forever?”“A Kind of Magic” (1986)
![Page 54: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/54.jpg)
Abandon obsolete modules
• Focus effort on fewer solutions.• More focus effort = better modules.• How many gallery systems do we need?
![Page 55: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/55.jpg)
WHAT’S NEXT?
![Page 56: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/56.jpg)
Contribute
• You depend upon Drupal for your future.• Drupal’s future depends upon you!
![Page 57: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/57.jpg)
Investments
• Invest minimum of 10% of income for retirement
• Invest 10% of your week to Drupal
![Page 58: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/58.jpg)
Time it
• 10% of 40 hour week• 4 hours per week• Friday evening!
![Page 59: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/59.jpg)
Companies can do more
• Have a large team?• Dedicated team contributor• Organize code sprints• & fly in experts
![Page 60: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/60.jpg)
Why?
• Learn more• Make your sites better• Make Drupal better• Everyone benefits!
![Page 61: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/61.jpg)
More info
• Novice issues• Examine code of small
modules you use• Poke around with dpm()
& kpr()• Read issue queues• Contribute!• http://webchick.net/
embrace-the-chaos
![Page 62: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/62.jpg)
Drupal’s future is up to us!
“The Show Must Go On”“Innuendo” (1977)
![Page 63: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/63.jpg)
THANK YOU
![Page 64: What to do when things go wrong with Drupal](https://reader034.vdocument.in/reader034/viewer/2022051608/544513e0afaf9f7e338b467a/html5/thumbnails/64.jpg)
Mediacurrent helps organizations architect custom websites by leveraging our proven processes and deep expertise in Drupal.
@mediacurrent mediacurrent.com