Experiences in migrating a Drupal 7 module to Drupal 8

Room: 
H-2
Audience: 
Beginner
Language: 
English

In this session, I will describe my experiences in updating a Drupal module from Drupal 7 to Drupal 8 (the adsense module). The session will describe the lessons learned in this process, including the removal of the previous "sub-module as plugins" system, and it's replacement with a true plugin system based on the infrastructure provided by Drupal 8. It will also advocate for a thorough removal of the .module file as much as possible. Some tools helpful for module development will also be addressed including:

  • Composer - to manage external dependencies.
  • Drupal Module Upgrader - for automatic update of code from D7 to D8.
  • Coder - static checks for coding standards.

 Main points to discuss on the subject of module development for Drupal 8:

  • module.info.yml and the other YAML files
  • Object Oriented Programming
  • PHP's PSR-4 and the module file structure
  • PHP Annotations
  • The Drupal 8 plugin system
  • Forms
  • Blocks
  • Twig templates
  • Page controllers and the routing system

Video: https://youtu.be/7dilUIWgYo0