SlideShare a Scribd company logo
1 of 64
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

Similar to What to do when things go wrong with Drupal

Well Planned is Half Done: Planning Projects in the Digitization World
Well Planned is Half Done: Planning Projects in the Digitization WorldWell Planned is Half Done: Planning Projects in the Digitization World
Well Planned is Half Done: Planning Projects in the Digitization WorldFlorida State University
 
New Developments in the BREACH attack
New Developments in the BREACH attackNew Developments in the BREACH attack
New Developments in the BREACH attackE Hacking
 
Project one world in india annela
Project one world in india annelaProject one world in india annela
Project one world in india annelaElli Kalju
 
Anderson montria mobile_presentationtemplate
Anderson montria mobile_presentationtemplateAnderson montria mobile_presentationtemplate
Anderson montria mobile_presentationtemplatemontria
 
Anderson montria mobile_presentation
Anderson montria mobile_presentationAnderson montria mobile_presentation
Anderson montria mobile_presentationmontria
 
Anderson montria mobile_presentation
Anderson montria mobile_presentationAnderson montria mobile_presentation
Anderson montria mobile_presentationmontria
 
Level Design Course Intro and Assingnts
Level Design Course Intro and AssingntsLevel Design Course Intro and Assingnts
Level Design Course Intro and AssingntsPetri Lankoski
 
Decorator Design Pattern
Decorator Design PatternDecorator Design Pattern
Decorator Design PatternAdeel Riaz
 
Power Assembly - TLs JNC2014
Power Assembly - TLs JNC2014Power Assembly - TLs JNC2014
Power Assembly - TLs JNC2014AIESEC in India
 
Bypassing malware detection mechanisms in online banking
Bypassing malware detection mechanisms in online bankingBypassing malware detection mechanisms in online banking
Bypassing malware detection mechanisms in online bankingJakub Kałużny
 
Keep Calm and Migrate: How to survive a digital content migration
Keep Calm and Migrate: How to survive a digital content migrationKeep Calm and Migrate: How to survive a digital content migration
Keep Calm and Migrate: How to survive a digital content migrationFlorida State University
 
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseGeek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseIDERA Software
 
How to become a practical Vim user
How to become a practical Vim userHow to become a practical Vim user
How to become a practical Vim userKana Natsuno
 
Information Audit and Card Sorting Exercise in One
Information Audit and Card Sorting Exercise in OneInformation Audit and Card Sorting Exercise in One
Information Audit and Card Sorting Exercise in OneSarah Burns
 
Using Solr to find the Right Person for the Right Job
Using Solr to find the Right Person for the Right JobUsing Solr to find the Right Person for the Right Job
Using Solr to find the Right Person for the Right JobLucidworks (Archived)
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design WorkshopFaye Tandog
 

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

Well Planned is Half Done: Planning Projects in the Digitization World
Well Planned is Half Done: Planning Projects in the Digitization WorldWell Planned is Half Done: Planning Projects in the Digitization World
Well Planned is Half Done: Planning Projects in the Digitization World
 
DiscoveringDH_ManagingDigitalProjects
DiscoveringDH_ManagingDigitalProjectsDiscoveringDH_ManagingDigitalProjects
DiscoveringDH_ManagingDigitalProjects
 
New Developments in the BREACH attack
New Developments in the BREACH attackNew Developments in the BREACH attack
New Developments in the BREACH attack
 
Tutorial 2
Tutorial 2Tutorial 2
Tutorial 2
 
Project one world in india annela
Project one world in india annelaProject one world in india annela
Project one world in india annela
 
Anderson montria mobile_presentationtemplate
Anderson montria mobile_presentationtemplateAnderson montria mobile_presentationtemplate
Anderson montria mobile_presentationtemplate
 
Anderson montria mobile_presentation
Anderson montria mobile_presentationAnderson montria mobile_presentation
Anderson montria mobile_presentation
 
Anderson montria mobile_presentation
Anderson montria mobile_presentationAnderson montria mobile_presentation
Anderson montria mobile_presentation
 
Level Design Course Intro and Assingnts
Level Design Course Intro and AssingntsLevel Design Course Intro and Assingnts
Level Design Course Intro and Assingnts
 
Tutorial 1
Tutorial 1Tutorial 1
Tutorial 1
 
Decorator Design Pattern
Decorator Design PatternDecorator Design Pattern
Decorator Design Pattern
 
Power Assembly - TLs JNC2014
Power Assembly - TLs JNC2014Power Assembly - TLs JNC2014
Power Assembly - TLs JNC2014
 
Bypassing malware detection mechanisms in online banking
Bypassing malware detection mechanisms in online bankingBypassing malware detection mechanisms in online banking
Bypassing malware detection mechanisms in online banking
 
Keep Calm and Migrate: How to survive a digital content migration
Keep Calm and Migrate: How to survive a digital content migrationKeep Calm and Migrate: How to survive a digital content migration
Keep Calm and Migrate: How to survive a digital content migration
 
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL DatabaseGeek Sync | Successfully Migrating Existing Databases to Azure SQL Database
Geek Sync | Successfully Migrating Existing Databases to Azure SQL Database
 
How to become a practical Vim user
How to become a practical Vim userHow to become a practical Vim user
How to become a practical Vim user
 
Information Audit and Card Sorting Exercise in One
Information Audit and Card Sorting Exercise in OneInformation Audit and Card Sorting Exercise in One
Information Audit and Card Sorting Exercise in One
 
Brand Contact
Brand ContactBrand Contact
Brand Contact
 
Using Solr to find the Right Person for the Right Job
Using Solr to find the Right Person for the Right JobUsing Solr to find the Right Person for the Right Job
Using Solr to find the Right Person for the Right Job
 
MCC Web Design Workshop
MCC Web Design WorkshopMCC Web Design Workshop
MCC Web Design Workshop
 

More from DrupalcampAtlanta2012

More from DrupalcampAtlanta2012 (9)

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

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

What to do when things go wrong with Drupal