What to do when things go wrong with Drupal

  • 2,514 views
Uploaded on

Slides from Damien McKenna's session "What to do when things go wrong with Drupal" from Drupalcamp Atlanta 2012.

Slides from Damien McKenna's session "What to do when things go wrong with Drupal" from Drupalcamp Atlanta 2012.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,514
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
4
Comments
0
Likes
2

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. What to do when things go wrong. (because it will)
  • 2. .. withCODE!
  • 3. .. andFreddie Mercury!
  • 4. Damien McKenna Lead Drupal Architect @DamienMcKenna drupal.org/user/108450
  • 5. “Freddie Mercury” Farrokh Bulsara Lead vocals Queen
  • 6. Drupal, Day 1
  • 7. Building with Drupal• Starting off..• Lots of trepidation• Infamous learning curve• Lots of reading – books, blogs, tutorials..• Lots of screencasts!
  • 8. Building with Drupal• Add Views & other modules• Add a little theming• Go a long way!
  • 9. Building more with Drupal• Start feeling comfortable• Add some more modules• Build lots of sites!
  • 10. o/“We Are The Champions”“News of the World” (1977) • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 11. Continuing on..• Install a module• Awesome!
  • 12. But then..Notice: Undefined index: option intheme_select_or_other_none() (line 249of/sites/all/modules/contrib/select_or_other/select_or_other.module).• Whaaa?
  • 13. Eek!• Line 249:• Whaaaaaaaaaaaaaaaa?
  • 14. That moment..“Going Slightly Mad”“Innuendo” (1977) • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 15. Drupalburp, noun;• A bug.• A small bug.• It’s still a bug.• There are lots of them.
  • 16. Step 1: Search issue queue • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 17. Step 1: Results• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 18. Step 1: Review• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 19. Step 2: Create a new issue! • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 20. Step 2: Create a new issue.. • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 21. Step 2: Issue created!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 22. Time to debug!
  • 23. Development Tips1. drupal_set_message()
  • 24. Whaaaa?• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 25. Development Tips1. drupal_set_message()2. debug()
  • 26. debug() output• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 27. Development Tips1. drupal_set_message()2. debug()3. Devel module4. dpm()
  • 28. dpm()• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 29. dpm() output• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 30. dpm() output awesomesauce! • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 31. Reviewing the error• “Undefined index”• Means that an array element doesn’t exist.• I can fix that!
  • 32. Original code• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 33. The fix• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 34. It works!• Time to share the joy!
  • 35. Get the code• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 36. Getting the code• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 37. Clone it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 38. Fix it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 39. Diff it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 40. Diff it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 41. Patch it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 42. 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
  • 43. Upload it!• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 44. And then..• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 45. 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.
  • 46. Development Tips1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!
  • 47. PATCHES.txt• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 48. Development Tips1. drupal_set_message()2. debug()3. Devel module4. dpm()5. Track your patches!6. kpr() and exit()
  • 49. kpr()• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 50. Development Tips1. 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
  • 51. MacGDBp• Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 52. Development Tips1. 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 MacGDBp8. Let modules die!
  • 53. Redundant: see redundant“Who Wants to Live Forever?”“A Kind of Magic” (1986) • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 54. Abandon obsolete modules• Focus effort on fewer solutions.• More focus effort = better modules.• How many gallery systems do we need?
  • 55. What’s next?
  • 56. Contribute• You depend upon Drupal for your future.• Drupal’s future depends upon you!
  • 57. Investments• Invest minimum of 10% of income for retirement• Invest 10% of your week to Drupal
  • 58. Time it• 10% of 40 hour week• 4 hours per week• Friday evening!
  • 59. Companies can do more• Have a large team?• Dedicated team contributor• Organize code sprints• & fly in experts
  • 60. Why?• Learn more• Make your sites better• Make Drupal better• Everyone benefits!
  • 61. More info• Novice issues• Examine code of small modules you use • Click to edit Master text styles• Poke around with dpm() – Second level & kpr() – Third level• Read issue queues • Fourth level – Fifth level• Contribute!• http://webchick.net/emb race-the-chaos
  • 62. Drupal’s future is up to us!“The Show Must Go On”“Innuendo” (1977) • Click to edit Master text styles – Second level – Third level • Fourth level – Fifth level
  • 63. Thank you
  • 64. Mediacurrent helps organizations architect custom websites byleveraging our proven processes and deep expertise in Drupal. @mediacurrent mediacurrent.com