Upload
ngokhue
View
227
Download
0
Embed Size (px)
Citation preview
Drupal 8 Module Development and Debugging
Lessons Learned from Upgrading the Node Hierarchy Module
About Dan Harris
● Founder Webdrips.com ○ Drupal-based web design and development shop ○ Founded in July, 2011. ○ Nine years Drupal experience○ 21 years professional experience.
● Twitter @webdrips● Email [email protected]
Agenda● D8 Development Overview
○ PhpStorm● Rapid Development with Drupal Console● D8 Debugging Tips & Tricks● Examples Module(s), demo● Review of Node Hierarchy Upgrade● Q&A Session
Drupal Console (DC)● Command line tool suite helps you learn D8
○ See the --learning option● Generates boilerplate D8 code / files● Uses same modern PHP practices as D8● Gets you up-and-running quickly● Provides high-level D8 debugging● Demo time
Drupal Console Demo
● We’ll look at the following○ drupal list○ drupal generate:module○ drupal generate:form:config○ drupal generate:permissions
Drupal Console Debugging
● We’ll run a few Drupal commands○ drupal config:debug○ drupal cron:debug○ drupal image:styles:debug
Drupal Examples Modules
● Solid D8 examples with good documentation● Examples for blocks, cache, config, new
content types, and much more.● Demo
Debugging Notes● Devel module to the rescue
○ Quick and dirty○ D8 ver. Uses Kint, the modern version of krumo○ For content entities, more may be needed
<?php
dpm($node->toArray());
dpm($node->getFieldDefinitions()); OR
dsm(get_object_vars($entity));
dsm(get_class_methods($entity));
?>
■
Drupal 8 Built-in Debugging
● Devel has a great backtrace function (demo)○ ddebug_backtrace();
● Drupal 8 includes a debugging mode for development sites○ Uses settings.local.php○ $config['system.logging']['error_level'] = 'verbose';
● Debugging plugins
Q & A Time
I’ll try to answer your questions now.
If you have any follow-up questions, email [email protected]
About Webdrips
● Webdrips provides concept to production web design and development.
● We turn complex business logic problems into sophisticated, yet easy-to-use sites.
● We provide websites that empower your content editors to make additions and changes to your website.