SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Future Proofing Your 
Drupal Skills 
Piyuesh Kumar 
QED42 
1
AGENDA: 
• Drupal 8 Api Changes: 
• Module info file 
• Routing System 
• Drupal 8 CMI & Using Config inspector 
• Writing forms and their submit handlers in d8. 
• Drupal 8 new plugin system 
• Basic changes to oftenly uses Drupal functions. 
2
Info File 
• Info files changed to info.yml 
• Old info file: {d7.info} 
• New info file: {d8.info.yml} 
3
Warning: 
Things are about to get... 
geeky. 
4
ROUTING SYSTEM 
• d7(hook_menu): 
5
D8 ROUTING 
SYSTEM(HOOK_MENU) 
• d8 conversion(hook_menu): 
• Hook_menu Lives until hook_default_menu_links() 
gets into core(https://drupal.org/node/2047633 
) 
6
D8 ROUTING 
SYSTEM(ROUTING.YML) 
• d8 conversion: 
• Callbacks and permissions are defined in a yml 
file.{d8.routing.yml} 
7
D8 ROUTING SYSTEM(WRITING 
CONTROLLERS) 
• d8 conversion: 
• Writing Page Callbacks 
8
D8 ROUTING SYSTEM(CORE 
CONTROLLERS) 
• _form 
• _content 
• _controller 
• _entity_form 
• _entity_list 
• and many more.. 
9
CONFIGURATION SCHEMA 
• R.I.P variable-get/variable_set 
10
CONFIGURATION SCHEMA 
• When would Config data get saved? 
• UI changes (automatic): When the save button 
is clicked on an admin page, data gets written to 
the active store as well as db. 
• Code changes (manual): use 
admin/config/development/sync to sync the 
config in code with db and active store. 
11
CMI(EXAMPLE) 
• D7: 
• D8: 
12
USING CONFIG INSPECTOR 
• https://drupal.org/project/config_inspector/git-instructions 
13
WRITING FORMS AND THEIR SUBMIT 
HANDLERS IN D8 
• FormInterface(https://api.drupal.org/api/drupal/c 
ore!lib!Drupal!Core!Form!FormInterface.php/interfa 
ce/FormInterface/8) 
• SystemConfigFormBase(http://drupalcontrib.org 
/api/drupal/drupal!core!modules!system!lib!Drupal!s 
ystem!SystemConfigFormBase.php/class/System 
ConfigFormBase/8) 
14
EXAMPLE 
• D7: 
15
EXAMPLE 
• D8: 
16
D8 FORMS(VALIDATION & 
SUBMISSION) 
• function validateForm(array &$form, array 
&$form_state) {} 
• function submitForm(array &$form, array 
&$form_state) {} 
17
D8 
FORMS(SYSTEM_SETTINGS_FORM 
??) 
• Extends SystemConfigFormBase: 
18
D8 FORMS(OTHER EXTENDABLE 
CLASSES IN CORE) 
• ConfirmFormBase(https://api.drupal.org/api/drupal/core!lib!Dru 
pal!Core!Form!ConfirmFormBase.php/class/ConfirmFormBase/ 
8) 
• BulkFormBase(https://api.drupal.org/api/drupal/core!modules!sy 
stem!lib!Drupal!system!Plugin!views!field!BulkFormBase.php/8) 
• FieldInstanceFormBase 
• ViewsFormBase(https://api.drupal.org/api/drupal/core!modules!vi 
ews_ui!lib!Drupal!views_ui!Form!Ajax!ViewsFormBase.php/class/ 
ViewsFormBase/8) 
19
WHAT HAPPENED TO DRUPAL_*_FORM 
FUNCTIONS? 
20
DRUPAL 8 NEW PLUGIN SYSTEM 
21
Module/hook system 
functions replaced with 
module handler 
service(https://drupal.org/n 
ode/1894902) 
22
Basic Function from d7 to d8 
• hook_init removed(https://drupal.org/node/2013014) 
• drupal_goto has been 
removed(https://drupal.org/node/2023537)e.g., 
drupal_goto($url)=>new RedirectResponse($url); 
• hook_boot has been removed(https://drupal.org/node/1909596) 
• $_GET[‘q'] has been 
removed(https://drupal.org/node/1659562) 
• drupal_*_form functions replaced with formBuilder service. e.g., 
drupal_get_from => Drupal::formBuilder()->getForm() 
• For more goto https://drupal.org/list-changes 
23
References 
Demo code is available at 
https://github.com/piyuesh23/Drupal8-demo 
• https://drupal.org/list-changes 
• http://previousnext.com.au/blog/controlling-access-drupal- 
8-routes-access-checks 
• https://drupal.org/node/1800686 
• DrupalCon Portland Videos 
(http://www.youtube.com/playlist?list=PLpeDXSh 
4nHjRlZKs7cj2L_kLI5osP5ERc) 
24

Weitere ähnliche Inhalte

Andere mochten auch

Creating Dynamic Landing Pages for Drupal with Panels - Webinar
Creating Dynamic Landing Pages for Drupal with Panels - WebinarCreating Dynamic Landing Pages for Drupal with Panels - Webinar
Creating Dynamic Landing Pages for Drupal with Panels - WebinarSuzanne Dergacheva
 
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...Mohammad Al-Ubaydli
 
operationalizing asthma analytic plan using omop cdm brandt
operationalizing asthma analytic plan using omop cdm brandtoperationalizing asthma analytic plan using omop cdm brandt
operationalizing asthma analytic plan using omop cdm brandtMarion Sills
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinSuzanne Dergacheva
 
Hl7 V3 Reference Models 20091123
Hl7 V3 Reference Models 20091123Hl7 V3 Reference Models 20091123
Hl7 V3 Reference Models 20091123Abdul-Malik Shakir
 

Andere mochten auch (8)

Paragraphs at drupal 8.
Paragraphs at drupal 8.Paragraphs at drupal 8.
Paragraphs at drupal 8.
 
Creating Dynamic Landing Pages for Drupal with Panels - Webinar
Creating Dynamic Landing Pages for Drupal with Panels - WebinarCreating Dynamic Landing Pages for Drupal with Panels - Webinar
Creating Dynamic Landing Pages for Drupal with Panels - Webinar
 
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...
Using a Shared Electronic Patient Record to Develop and Assess e-Consultation...
 
operationalizing asthma analytic plan using omop cdm brandt
operationalizing asthma analytic plan using omop cdm brandtoperationalizing asthma analytic plan using omop cdm brandt
operationalizing asthma analytic plan using omop cdm brandt
 
Amia now! session two
Amia now! session twoAmia now! session two
Amia now! session two
 
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon DublinCreating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
 
HIE technical infrastructure
HIE technical infrastructureHIE technical infrastructure
HIE technical infrastructure
 
Hl7 V3 Reference Models 20091123
Hl7 V3 Reference Models 20091123Hl7 V3 Reference Models 20091123
Hl7 V3 Reference Models 20091123
 

Ähnlich wie Drupal 8 DX Changes

How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?DrupalGeeks
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationAmeex Technologies
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesShabir Ahmad
 
A new tool for measuring performance in Drupal 8 - DrupalCamp London
A new tool for measuring performance in Drupal 8 - DrupalCamp LondonA new tool for measuring performance in Drupal 8 - DrupalCamp London
A new tool for measuring performance in Drupal 8 - DrupalCamp LondonLuca Lusso
 
Drupal 8 overview
Drupal 8 overviewDrupal 8 overview
Drupal 8 overviewikonamitech
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Acquia
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...Eric Sembrat
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Drupal 8 update: May 2014. Migrate in core.
Drupal 8 update: May 2014. Migrate in core.Drupal 8 update: May 2014. Migrate in core.
Drupal 8 update: May 2014. Migrate in core.Vladimir Roudakov
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011camp_drupal_ua
 
13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS 13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS DrupalMumbai
 
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...DataScienceConferenc1
 
Config management
Config managementConfig management
Config managementAlexei Goja
 
Taking your module from Drupal 6 to Drupal 7
Taking your module from Drupal 6 to Drupal 7Taking your module from Drupal 6 to Drupal 7
Taking your module from Drupal 6 to Drupal 7Phase2
 
DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DrupalDay
 
Hadoop course content Syed Academy
Hadoop course content Syed AcademyHadoop course content Syed Academy
Hadoop course content Syed AcademySyed Hadoop
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionSaravanaMuthu Jayaraj
 

Ähnlich wie Drupal 8 DX Changes (20)

How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?How to Migrate Drupal 6 to Drupal 8?
How to Migrate Drupal 6 to Drupal 8?
 
Drupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 MigrationDrupal 6 to Drupal 8 Migration
Drupal 6 to Drupal 8 Migration
 
features+
features+features+
features+
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Drupal 8 - Core and API Changes
Drupal 8 - Core and API ChangesDrupal 8 - Core and API Changes
Drupal 8 - Core and API Changes
 
A new tool for measuring performance in Drupal 8 - DrupalCamp London
A new tool for measuring performance in Drupal 8 - DrupalCamp LondonA new tool for measuring performance in Drupal 8 - DrupalCamp London
A new tool for measuring performance in Drupal 8 - DrupalCamp London
 
Drupal 8 overview
Drupal 8 overviewDrupal 8 overview
Drupal 8 overview
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
October 2016 - USG Rock Eagle - Everything You Need to Know to Plan Your Drup...
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Drupal online training - GoLogica
Drupal online training - GoLogicaDrupal online training - GoLogica
Drupal online training - GoLogica
 
Drupal 8 update: May 2014. Migrate in core.
Drupal 8 update: May 2014. Migrate in core.Drupal 8 update: May 2014. Migrate in core.
Drupal 8 update: May 2014. Migrate in core.
 
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
Andriy Podanenko.Drupal database api.DrupalCamp Kyiv 2011
 
13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS 13th Sep, Drupal 7 advanced training by TCS
13th Sep, Drupal 7 advanced training by TCS
 
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
[DSC Europe 23] Matteo Molteni - Implementing a Robust CI Workflow with dbt f...
 
Config management
Config managementConfig management
Config management
 
Taking your module from Drupal 6 to Drupal 7
Taking your module from Drupal 6 to Drupal 7Taking your module from Drupal 6 to Drupal 7
Taking your module from Drupal 6 to Drupal 7
 
DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8
 
Hadoop course content Syed Academy
Hadoop course content Syed AcademyHadoop course content Syed Academy
Hadoop course content Syed Academy
 
ColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introductionColdFusion Fw1 (FrameWork1) introduction
ColdFusion Fw1 (FrameWork1) introduction
 

Kürzlich hochgeladen

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Drupal 8 DX Changes

  • 1. Future Proofing Your Drupal Skills Piyuesh Kumar QED42 1
  • 2. AGENDA: • Drupal 8 Api Changes: • Module info file • Routing System • Drupal 8 CMI & Using Config inspector • Writing forms and their submit handlers in d8. • Drupal 8 new plugin system • Basic changes to oftenly uses Drupal functions. 2
  • 3. Info File • Info files changed to info.yml • Old info file: {d7.info} • New info file: {d8.info.yml} 3
  • 4. Warning: Things are about to get... geeky. 4
  • 5. ROUTING SYSTEM • d7(hook_menu): 5
  • 6. D8 ROUTING SYSTEM(HOOK_MENU) • d8 conversion(hook_menu): • Hook_menu Lives until hook_default_menu_links() gets into core(https://drupal.org/node/2047633 ) 6
  • 7. D8 ROUTING SYSTEM(ROUTING.YML) • d8 conversion: • Callbacks and permissions are defined in a yml file.{d8.routing.yml} 7
  • 8. D8 ROUTING SYSTEM(WRITING CONTROLLERS) • d8 conversion: • Writing Page Callbacks 8
  • 9. D8 ROUTING SYSTEM(CORE CONTROLLERS) • _form • _content • _controller • _entity_form • _entity_list • and many more.. 9
  • 10. CONFIGURATION SCHEMA • R.I.P variable-get/variable_set 10
  • 11. CONFIGURATION SCHEMA • When would Config data get saved? • UI changes (automatic): When the save button is clicked on an admin page, data gets written to the active store as well as db. • Code changes (manual): use admin/config/development/sync to sync the config in code with db and active store. 11
  • 12. CMI(EXAMPLE) • D7: • D8: 12
  • 13. USING CONFIG INSPECTOR • https://drupal.org/project/config_inspector/git-instructions 13
  • 14. WRITING FORMS AND THEIR SUBMIT HANDLERS IN D8 • FormInterface(https://api.drupal.org/api/drupal/c ore!lib!Drupal!Core!Form!FormInterface.php/interfa ce/FormInterface/8) • SystemConfigFormBase(http://drupalcontrib.org /api/drupal/drupal!core!modules!system!lib!Drupal!s ystem!SystemConfigFormBase.php/class/System ConfigFormBase/8) 14
  • 17. D8 FORMS(VALIDATION & SUBMISSION) • function validateForm(array &$form, array &$form_state) {} • function submitForm(array &$form, array &$form_state) {} 17
  • 18. D8 FORMS(SYSTEM_SETTINGS_FORM ??) • Extends SystemConfigFormBase: 18
  • 19. D8 FORMS(OTHER EXTENDABLE CLASSES IN CORE) • ConfirmFormBase(https://api.drupal.org/api/drupal/core!lib!Dru pal!Core!Form!ConfirmFormBase.php/class/ConfirmFormBase/ 8) • BulkFormBase(https://api.drupal.org/api/drupal/core!modules!sy stem!lib!Drupal!system!Plugin!views!field!BulkFormBase.php/8) • FieldInstanceFormBase • ViewsFormBase(https://api.drupal.org/api/drupal/core!modules!vi ews_ui!lib!Drupal!views_ui!Form!Ajax!ViewsFormBase.php/class/ ViewsFormBase/8) 19
  • 20. WHAT HAPPENED TO DRUPAL_*_FORM FUNCTIONS? 20
  • 21. DRUPAL 8 NEW PLUGIN SYSTEM 21
  • 22. Module/hook system functions replaced with module handler service(https://drupal.org/n ode/1894902) 22
  • 23. Basic Function from d7 to d8 • hook_init removed(https://drupal.org/node/2013014) • drupal_goto has been removed(https://drupal.org/node/2023537)e.g., drupal_goto($url)=>new RedirectResponse($url); • hook_boot has been removed(https://drupal.org/node/1909596) • $_GET[‘q'] has been removed(https://drupal.org/node/1659562) • drupal_*_form functions replaced with formBuilder service. e.g., drupal_get_from => Drupal::formBuilder()->getForm() • For more goto https://drupal.org/list-changes 23
  • 24. References Demo code is available at https://github.com/piyuesh23/Drupal8-demo • https://drupal.org/list-changes • http://previousnext.com.au/blog/controlling-access-drupal- 8-routes-access-checks • https://drupal.org/node/1800686 • DrupalCon Portland Videos (http://www.youtube.com/playlist?list=PLpeDXSh 4nHjRlZKs7cj2L_kLI5osP5ERc) 24