SlideShare a Scribd company logo
What to do when things go wrong.
                     (because it will)
.. with
CODE!
.. and
Freddie Mercury!
Damien McKenna
    Lead Drupal Architect
      @DamienMcKenna
  drupal.org/user/108450
“Freddie Mercury”
    Farrokh Bulsara
           Lead vocals
                Queen
Drupal, Day 1
Building with Drupal
• Starting off..
• Lots of trepidation
• Infamous learning curve
• Lots of reading – books, blogs, tutorials..
• Lots of screencasts!
Building with Drupal
• Add Views & other modules
• Add a little theming
• Go a long way!
Building more with Drupal
• Start feeling comfortable
• Add some more modules
• Build lots of sites!
o/
“We Are The Champions”
“News of the World” (1977)
                         • Click to edit Master text styles
                             – Second level
                             – Third level
                                 • Fourth level
                                     – Fifth level
Continuing on..
• Install a module




• Awesome!
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?
Eek!
• Line 249:




• Whaaaaaaaaaaaaaaaa?
That moment..
“Going Slightly Mad”
“Innuendo” (1977)
                       • Click to edit Master text styles
                          – Second level
                          – Third level
                              • Fourth level
                                  – Fifth level
Drupalburp, noun;
• A bug.
• A small bug.
• It’s still a bug.
• There are lots of them.
Step 1: Search issue queue
     • Click to edit Master text styles
       – Second level
       – Third level
          • Fourth level
              – Fifth level
Step 1: Results
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Step 1: Review
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Step 2: Create a new issue!
     • Click to edit Master text styles
        – Second level
        – Third level
           • Fourth level
               – Fifth level
Step 2: Create a new issue..
      • Click to edit Master text styles
        – Second level
        – Third level
           • Fourth level
               – Fifth level
Step 2: Issue created!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Time to debug!
Development Tips
1. drupal_set_message()
Whaaaa?
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Development Tips
1. drupal_set_message()
2. debug()
debug() output
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Development Tips
1. drupal_set_message()
2. debug()
3. Devel module
4. dpm()
dpm()
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
dpm() output
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
dpm() output awesomesauce!
     • Click to edit Master text styles
       – Second level
       – Third level
          • Fourth level
              – Fifth level
Reviewing the error
• “Undefined index”
• Means that an array element doesn’t exist.
• I can fix that!
Original code
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
The fix
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
It works!
• Time to share the joy!
Get the code
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Getting the code
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Clone it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Fix it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Diff it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Diff it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Patch it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
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
Upload it!
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
And then..
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
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.
Development Tips
1. drupal_set_message()
2. debug()
3. Devel module
4. dpm()
5. Track your patches!
PATCHES.txt
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Development Tips
1. drupal_set_message()
2. debug()
3. Devel module
4. dpm()
5. Track your patches!
6. kpr() and exit()
kpr()
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Development Tips
1. drupal_set_message()
2. debug()
3. Devel module
4. dpm()
5. Track your patches!
6. kpr() and exit()
7. xdebug – hardcore debugging!
  •   .. and IDE debugger or MacGDBp
MacGDBp
• Click to edit Master text styles
  – Second level
  – Third level
     • Fourth level
         – Fifth level
Development Tips
1. drupal_set_message()
2. debug()
3. Devel module
4. dpm()
5. Track your patches!
6. kpr() and exit()
7. xdebug – hardcore debugging!
  •   .. and IDE debugger or MacGDBp
8. Let modules die!
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
Abandon obsolete modules
• Focus effort on fewer solutions.
• More focus effort = better modules.
• How many gallery systems do we need?
What’s next?
Contribute
• You depend upon Drupal for your future.
• Drupal’s future depends upon you!
Investments
• Invest minimum of 10% of income for
  retirement
• Invest 10% of your week to Drupal
Time it
• 10% of 40 hour week
• 4 hours per week
• Friday evening!
Companies can do more
• Have a large team?
• Dedicated team contributor
• Organize code sprints
• & fly in experts
Why?
• Learn more
• Make your sites better
• Make Drupal better
• Everyone benefits!
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
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
Thank you
Mediacurrent helps organizations architect custom websites by
leveraging our proven processes and deep expertise in Drupal.



       @mediacurrent               mediacurrent.com

More Related Content

KEY
Project Tools in Web Development
PDF
Agile / Lean Practitioners Meetup: Two Biz Funk Teams Go Lean: An Audience-Wi...
PPTX
What to do? When things go wrong.
PDF
What to do when things go wrong
PPTX
our life vs eternity
PPTX
Social media strategies in the workplace
PPTX
For Teenagers: When Things Go Wrong - Look To God
PDF
Drupal Roadmap 2010
Project Tools in Web Development
Agile / Lean Practitioners Meetup: Two Biz Funk Teams Go Lean: An Audience-Wi...
What to do? When things go wrong.
What to do when things go wrong
our life vs eternity
Social media strategies in the workplace
For Teenagers: When Things Go Wrong - Look To God
Drupal Roadmap 2010

Similar to What to do when things go wrong with Drupal (20)

PDF
Twig & the new theme layer in Drupal 8
PPTX
Information Audit and Card Sorting Exercise in One
ODP
Start Your Own Bug Squad
PPTX
How to contribute projects to drupal.org? 2018 drupal north
ODP
Get in Drupal, Get in the community
KEY
Teaching Drupal
PDF
An example graph visualization with Processing.js
PDF
Drupal For Designers 1st Edition Dani Nordin
PPT
Googling Your Way to Drupal Success (11/05/25 - Inky Serritslev)
PPTX
Microsoft Cloud Computing
KEY
Drupal in Action (CMS Expo 2011)
PPTX
Debugging SEO - Language & Breaking Down
PPT
Contributing to Drupal
PPT
Documentation of surgical procedure
PDF
Drupal in-depth
PDF
Drupal 8: A story of growing up and getting off the island
PPTX
Drupal club
PDF
Drupal intro-short
PDF
Drupal 8. What's cooking (based on Angela Byron slides)
PDF
How, When, and Why to Patch a Module
Twig & the new theme layer in Drupal 8
Information Audit and Card Sorting Exercise in One
Start Your Own Bug Squad
How to contribute projects to drupal.org? 2018 drupal north
Get in Drupal, Get in the community
Teaching Drupal
An example graph visualization with Processing.js
Drupal For Designers 1st Edition Dani Nordin
Googling Your Way to Drupal Success (11/05/25 - Inky Serritslev)
Microsoft Cloud Computing
Drupal in Action (CMS Expo 2011)
Debugging SEO - Language & Breaking Down
Contributing to Drupal
Documentation of surgical procedure
Drupal in-depth
Drupal 8: A story of growing up and getting off the island
Drupal club
Drupal intro-short
Drupal 8. What's cooking (based on Angela Byron slides)
How, When, and Why to Patch a Module
Ad

More from DrupalcampAtlanta2012 (9)

PDF
Getting Started with Drupal Services with Randall Kent @ DrupalCamp Atlanta 2012
PDF
Designing for Content Management Systems
KEY
Advanced theming
PDF
Drupalcamp armedia phonegap_oct2012_print
PDF
Getting started with Drush
PDF
Talking to Web Services
PDF
Drupal + HTML5 + CSS3 + JS = Rich Internet Application
PDF
Drupal Rules!
PDF
Dig into the omega theme
Getting Started with Drupal Services with Randall Kent @ DrupalCamp Atlanta 2012
Designing for Content Management Systems
Advanced theming
Drupalcamp armedia phonegap_oct2012_print
Getting started with Drush
Talking to Web Services
Drupal + HTML5 + CSS3 + JS = Rich Internet Application
Drupal Rules!
Dig into the omega theme
Ad

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Spectroscopy.pptx food analysis technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Machine Learning_overview_presentation.pptx
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
cuic standard and advanced reporting.pdf
PDF
Encapsulation theory and applications.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Spectroscopy.pptx food analysis technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
20250228 LYD VKU AI Blended-Learning.pptx
Network Security Unit 5.pdf for BCA BBA.
Machine Learning_overview_presentation.pptx
A comparative analysis of optical character recognition models for extracting...
Mobile App Security Testing_ A Comprehensive Guide.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25-Week II
cuic standard and advanced reporting.pdf
Encapsulation theory and applications.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation

What to do when things go wrong with Drupal