SlideShare uma empresa Scribd logo
1 de 28
Baixar para ler offline
The Drupal 7 Worst
Practices Catalogue
Hacking the Core
Don't hack the Core
Hacking contributed
modules
Contribute and log any patch on D.O.: then
you have a contributed patch that can be
applied automatically with drush-make
Use limited code getways for Custom
module compatibility
Having only a few lines to modify is not
an acceptable way to justify hacking
contributed code
Handmade Features
Use Features Builder
Contribute your approach
Versioning
contributed code
Use drush-make or Composer
Versioning dumps 

& archives
Use a shared file system
Using Drupal 

as a Php empty shell
Using Drupal module structure is not
enough
Writing code that pass Coder /
Code-Sniffer is not enough
Writing trully Drupal compliant
code
Placing files in
Core
Consider Drupal Core as a Vendor
Running Php code 

out of modules
Adding Php code that can be
directly triggered is a security
threat
Using multi-sites 

when not necessary
Multi-sites is mainly used for bad
reasons
Manage your code in Git and
deploy
Using DB prefix 

when not necessary
Make sure your Drupal database is
only used by a given instance
Sharing DB tables
Use services
Writing functions 

that can’t be tested
Even if you don't write test, you
should be able to write simple and
straight tests for your function
If one drupalist can't get it at first
read, refactor
Not using Drupal
API
Make sure you don't write code
already available in Drupal
e.g. Mail address format validation
Keeping dead code
You might have some disabled
modules, part of needed modules
package
Don't keep unused code
Don't keep multiple
versions of a module
Don't keep modules out of the
modules paths
If you don't use multi-sites, you
shouldn't have multiple versions of a
given module (except for overriding
Profiles versions)
Not using Views
You might have very targetting needs
and good reasons to write queries
in cutom modules
If you never use Views and believe
your code is always better, you will
be in trouble soon - and meet
maintainability and debugging issues
Using ancient best
practices
Multi-sites is an example of these ancient
best practices
Webform is another one: prefer EntityForm
Don't be afraid to move on, reconsider your
best practices once a year
Read blogs, meet others drupalists and don't
believe you know - check again everyday
Deploying content 

with Features
Use Deploy suite (based on services) or
sync your database and files from Prod
while deploying
First af all: take a little time to define
what is content on each and every project
Design might be content, as much as
taxonomies and nodes
Managing 

too much templates
When is too much? You actually already know it
If the workflow is driven by the Front (HTML /
CCS / JS) team, having a lot of templates is OK
as it's meant by the project organisation - and
the integrator might even directly work in the
theme repository
Otherwise, you might consider modules like
SemanticFields and SemanticViews to cleanup
Drupal code generation
Relying on Drupal
search
Beyong 100 contents, just use a real
search engine
Relying on Drupal
cache
Drupal native cache is very limited
and a little stupid
Many modules offer higher quality
solutions
Using a single
theme
Use sub-themes
Base theme should be technical and web standards
oriented
Sub-theme bears the design
If you expect to reuse this sub-theme on multiple project:
consider it as a Charte theme, and never enable it
Then use a project dedicated sub-theme that will be
enabled, and override the Charte theme: it might even
override nothing
Modifying admin
theme
Obviously, this is a contributed
module - so don't touch it
Create a sub-theme, and override
what is needed
Usually, you will have 5 items in a
custom CSS file
Mixing up Features code 

& Module code
Acquia Commons is a good example
of this practice
It provides maintainability issues such
as impossibility to override features
Module code needs to be maintained
by humans, while Features is project
driven generated code
Keeping Dev tools
in Prod
(no comment)
Keeping too much
information in Prod
install.php, .txt and .md files from
Drupal root can be deleted
So is web.config if not using IIS
(or .htaccess if not used by Apache)
Storing database
dump in Drupal path
Find some other place

Mais conteúdo relacionado

Mais procurados

Sand camp beginner drupal development
Sand camp beginner drupal developmentSand camp beginner drupal development
Sand camp beginner drupal developmentmeghsweet
 
Java Consulting tips for Beginners
Java Consulting tips for BeginnersJava Consulting tips for Beginners
Java Consulting tips for BeginnersSathish Chittibabu
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codeMichal Juhas
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 
Building an open source python application the right way
Building an open source python application the right wayBuilding an open source python application the right way
Building an open source python application the right wayKiran Gangadharan
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012Joe Querin
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migrationhenri_makembe
 
WordPress plugin development
WordPress plugin developmentWordPress plugin development
WordPress plugin developmentarryaas
 
How to become a word press developer | Wordpress Training in Chandigarh
How to become a word press developer | Wordpress Training in ChandigarhHow to become a word press developer | Wordpress Training in Chandigarh
How to become a word press developer | Wordpress Training in ChandigarhCbitss Technologies
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practicesMichal Juhas
 
Learning Joomla! in a weekend (for developers)
Learning Joomla! in a weekend (for developers)Learning Joomla! in a weekend (for developers)
Learning Joomla! in a weekend (for developers)Valentin Despa
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureTim Plummer
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimizationhenri_makembe
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme developmenthenri_makembe
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forwardМарина Босова
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with CypressApplitools
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetshenri_makembe
 

Mais procurados (20)

Zend framework 01 - introduction
Zend framework 01 - introductionZend framework 01 - introduction
Zend framework 01 - introduction
 
Sand camp beginner drupal development
Sand camp beginner drupal developmentSand camp beginner drupal development
Sand camp beginner drupal development
 
Java Consulting tips for Beginners
Java Consulting tips for BeginnersJava Consulting tips for Beginners
Java Consulting tips for Beginners
 
PHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the codePHP Frameworks, or how I learnt to stop worrying and love the code
PHP Frameworks, or how I learnt to stop worrying and love the code
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Building an open source python application the right way
Building an open source python application the right wayBuilding an open source python application the right way
Building an open source python application the right way
 
Theme development essentials columbus oh word camp 2012
Theme development essentials   columbus oh word camp 2012Theme development essentials   columbus oh word camp 2012
Theme development essentials columbus oh word camp 2012
 
Lotus Framework
Lotus FrameworkLotus Framework
Lotus Framework
 
Week 11 - Hosting and Migration
Week 11 - Hosting and MigrationWeek 11 - Hosting and Migration
Week 11 - Hosting and Migration
 
WordPress plugin development
WordPress plugin developmentWordPress plugin development
WordPress plugin development
 
How to become a word press developer | Wordpress Training in Chandigarh
How to become a word press developer | Wordpress Training in ChandigarhHow to become a word press developer | Wordpress Training in Chandigarh
How to become a word press developer | Wordpress Training in Chandigarh
 
iOS development best practices
iOS development best practicesiOS development best practices
iOS development best practices
 
Learning Joomla! in a weekend (for developers)
Learning Joomla! in a weekend (for developers)Learning Joomla! in a weekend (for developers)
Learning Joomla! in a weekend (for developers)
 
Whats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in futureWhats new in joomla 3.5 & whats coming in future
Whats new in joomla 3.5 & whats coming in future
 
Bootstrap 4 n00bz
Bootstrap 4 n00bzBootstrap 4 n00bz
Bootstrap 4 n00bz
 
Week 12 - Search Engine Optimization
Week 12 -  Search Engine OptimizationWeek 12 -  Search Engine Optimization
Week 12 - Search Engine Optimization
 
Week 7 introduction to theme development
Week 7   introduction to theme developmentWeek 7   introduction to theme development
Week 7 introduction to theme development
 
06 integrating extra features and looking forward
06   integrating extra features and looking forward06   integrating extra features and looking forward
06 integrating extra features and looking forward
 
How to Get Started with Cypress
How to Get Started with CypressHow to Get Started with Cypress
How to Get Started with Cypress
 
Week 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgetsWeek 5 - Introduction to plug-ins and widgets
Week 5 - Introduction to plug-ins and widgets
 

Semelhante a The Drupal 7 Worst Practices Catalogue

Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to DrupalChris Skene
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practicesSynapseindiappsdevelopment
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsMicky Metts
 
Creating Drupal A Module
Creating Drupal A ModuleCreating Drupal A Module
Creating Drupal A Modulearcaneadam
 
Building API's
Building API'sBuilding API's
Building API'sarcaneadam
 
Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectIztok Smolic
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module developmentRachit Gupta
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupalmayank.grd
 
Drupal 6x Installation
Drupal 6x Installation Drupal 6x Installation
Drupal 6x Installation Micky Metts
 
Dipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module DevelopmentDipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module DevelopmentSuzanne Dergacheva
 
Think Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot OrgThink Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot OrgKafle G
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
TEI ODD based development
TEI ODD based developmentTEI ODD based development
TEI ODD based developmentEduard Drenth
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceJoomlaDay Australia
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software EngineerSean Coates
 

Semelhante a The Drupal 7 Worst Practices Catalogue (20)

Drupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating ModulesDrupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating Modules
 
Contributing to Drupal
Contributing to DrupalContributing to Drupal
Contributing to Drupal
 
SynapseIndia drupal presentation on drupal best practices
SynapseIndia drupal  presentation on drupal best practicesSynapseIndia drupal  presentation on drupal best practices
SynapseIndia drupal presentation on drupal best practices
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal Concepts
 
Creating Drupal A Module
Creating Drupal A ModuleCreating Drupal A Module
Creating Drupal A Module
 
Building API's
Building API'sBuilding API's
Building API's
 
Top 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal projectTop 20 mistakes you will make on your 1st Drupal project
Top 20 mistakes you will make on your 1st Drupal project
 
Drupal
DrupalDrupal
Drupal
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
Drupal module development
Drupal module developmentDrupal module development
Drupal module development
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
 
Hacking core
Hacking coreHacking core
Hacking core
 
Drupal 6x Installation
Drupal 6x Installation Drupal 6x Installation
Drupal 6x Installation
 
Dipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module DevelopmentDipping Your Toe into Drupal 8 Module Development
Dipping Your Toe into Drupal 8 Module Development
 
The Drupal Way
The Drupal WayThe Drupal Way
The Drupal Way
 
Think Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot OrgThink Before You Submit Themes on WordPress dot Org
Think Before You Submit Themes on WordPress dot Org
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
TEI ODD based development
TEI ODD based developmentTEI ODD based development
TEI ODD based development
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experience
 
30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer30 Skills to Master to Become a Senior Software Engineer
30 Skills to Master to Become a Senior Software Engineer
 

Último

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 

Último (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 

The Drupal 7 Worst Practices Catalogue

  • 1. The Drupal 7 Worst Practices Catalogue
  • 2. Hacking the Core Don't hack the Core
  • 3. Hacking contributed modules Contribute and log any patch on D.O.: then you have a contributed patch that can be applied automatically with drush-make Use limited code getways for Custom module compatibility Having only a few lines to modify is not an acceptable way to justify hacking contributed code
  • 4. Handmade Features Use Features Builder Contribute your approach
  • 6. Versioning dumps 
 & archives Use a shared file system
  • 7. Using Drupal 
 as a Php empty shell Using Drupal module structure is not enough Writing code that pass Coder / Code-Sniffer is not enough Writing trully Drupal compliant code
  • 8. Placing files in Core Consider Drupal Core as a Vendor
  • 9. Running Php code 
 out of modules Adding Php code that can be directly triggered is a security threat
  • 10. Using multi-sites 
 when not necessary Multi-sites is mainly used for bad reasons Manage your code in Git and deploy
  • 11. Using DB prefix 
 when not necessary Make sure your Drupal database is only used by a given instance
  • 13. Writing functions 
 that can’t be tested Even if you don't write test, you should be able to write simple and straight tests for your function If one drupalist can't get it at first read, refactor
  • 14. Not using Drupal API Make sure you don't write code already available in Drupal e.g. Mail address format validation
  • 15. Keeping dead code You might have some disabled modules, part of needed modules package Don't keep unused code
  • 16. Don't keep multiple versions of a module Don't keep modules out of the modules paths If you don't use multi-sites, you shouldn't have multiple versions of a given module (except for overriding Profiles versions)
  • 17. Not using Views You might have very targetting needs and good reasons to write queries in cutom modules If you never use Views and believe your code is always better, you will be in trouble soon - and meet maintainability and debugging issues
  • 18. Using ancient best practices Multi-sites is an example of these ancient best practices Webform is another one: prefer EntityForm Don't be afraid to move on, reconsider your best practices once a year Read blogs, meet others drupalists and don't believe you know - check again everyday
  • 19. Deploying content 
 with Features Use Deploy suite (based on services) or sync your database and files from Prod while deploying First af all: take a little time to define what is content on each and every project Design might be content, as much as taxonomies and nodes
  • 20. Managing 
 too much templates When is too much? You actually already know it If the workflow is driven by the Front (HTML / CCS / JS) team, having a lot of templates is OK as it's meant by the project organisation - and the integrator might even directly work in the theme repository Otherwise, you might consider modules like SemanticFields and SemanticViews to cleanup Drupal code generation
  • 21. Relying on Drupal search Beyong 100 contents, just use a real search engine
  • 22. Relying on Drupal cache Drupal native cache is very limited and a little stupid Many modules offer higher quality solutions
  • 23. Using a single theme Use sub-themes Base theme should be technical and web standards oriented Sub-theme bears the design If you expect to reuse this sub-theme on multiple project: consider it as a Charte theme, and never enable it Then use a project dedicated sub-theme that will be enabled, and override the Charte theme: it might even override nothing
  • 24. Modifying admin theme Obviously, this is a contributed module - so don't touch it Create a sub-theme, and override what is needed Usually, you will have 5 items in a custom CSS file
  • 25. Mixing up Features code 
 & Module code Acquia Commons is a good example of this practice It provides maintainability issues such as impossibility to override features Module code needs to be maintained by humans, while Features is project driven generated code
  • 26. Keeping Dev tools in Prod (no comment)
  • 27. Keeping too much information in Prod install.php, .txt and .md files from Drupal root can be deleted So is web.config if not using IIS (or .htaccess if not used by Apache)
  • 28. Storing database dump in Drupal path Find some other place