SlideShare ist ein Scribd-Unternehmen logo
1 von 45
#D8CX
Kate Marshalkina & Konstantin Komelin
DrupalCamp Kyiv 2013 Start Here
Upgrade your modules
to Drupal 8
A Little More About Us
2
DrupalCamp Kyiv 2013
[Moscow, Russia]
• UI Cache Clear module author
• Contributor to several modules
• Web developer at Licel LLC
[Saint Petersburg, Russia]
• Author of Yandex.Metrics, Pinned Site
• Contributor to modules and themes
• Co-organizer of Drupal Community in St. Petersburg
• Individual web developer, trainer and consultant
Kate Marshalkina kalabro
Konstantin Komelin KKomelin
What is Drupal 8?
3
DrupalCamp Kyiv 2013
Drupal 8
≠
LOREM IPSUM DOLOREM COMPANY Insert You Tagline Here
Drupal 8 — Drupal,even better!
4
Mobilesupport&inlineediting
5
DrupalCamp Kyiv 2013
#D8CX: Drupal 8 Contrib Experience
• Release top 40 modules together with D8
• 27 modules with #D8CX flag (Jun 8, 2013)
• Not only top modules are important!
#D8CX: I pledge that UI Cache Clear will have a full Drupal 8 release on the day that
Drupal 8 is released.
#D8CX: We pledge that Yandex.Metrics will have a full Drupal 8 release on the day
that Drupal 8 is released.
#D8CX: I pledge that Yandex Services Authorization API will have a full Drupal 8
release on the day that Drupal 8 is released.
6
DrupalCamp Kyiv 2013
Why should I upgrade?
7
DrupalCamp Kyiv 2013
• Be one of the first
• Prepare to D8
• Learn Drupal 8 API
• Help to community and Drupal
• Just for fun ;)
When should I start?
8
DrupalCamp Kyiv 2013
“In Villabajo they are still drilling the core and don’t have agreements about
many things, and in Villarriba others have already upgraded modules”
D8 begins
Mar 10, 2011
Alpha1 RC
Dec, 2013
Beta
May 20, 2013
Drupal 8.0
Sep-Oct, 2013
July, 2013
Our examples>
DrupalCamp Kyiv 2013
Yandex.Metrics (8.x)
10
DrupalCamp Kyiv 2013
UI Cache Clear (7.x)
11
DrupalCamp Kyiv 2013
UI Cache Clear (8.x)
12
DrupalCamp Kyiv 2013
13
DrupalCamp Kyiv 2013
New home for sites/all/*
Drupal 7 Drupal 8
A new folder structure
Before you start
14
DrupalCamp Kyiv 2013
• Update PHP to 5.3.10
• Reconcile to o_OP
• Get used to use https://drupal.org/list-changes
• Be ready to reinstall Drupal
• Prepare your rocket ;)
Find 5 differences
15
DrupalCamp Kyiv 2013
Drupal 7 Drupal 8
name = 'Yandex.Metrics Counter'
core = 7.x
files[] = yandex_metrics.test
name: 'Yandex.Metrics Counter'
core: 8.x
type: module
yandex_metrics.info yandex_metrics.info.yml
16
Hurray!
We’ve just upgraded the module!
Thanks for coming!
Goodbye :-P
hook_menu and routing
17
DrupalCamp Kyiv 2013
function yandex_metrics_menu() {
$items['admin/config/system/yandex_metrics'] = array(
'title' => 'Yandex.Metrics',
'route_name' => 'yandex_metrics_counter_settings',
);
// ...
}
yandex_metrics.moduleStep 2
yandex_metrics_counter_settings:
pattern: '/admin/config/system/yandex_metrics'
defaults:
_form: 'Drupalyandex_metricsFormYandexMetricsCounterSettingsForm'
requirements:
_permission: 'administer Yandex.Metrics settings'
yandex_metrics.routing.ymlStep 1
Settings form
18
DrupalCamp Kyiv 2013
namespace Drupalyandex_metricsForm;
use DrupalsystemSystemConfigFormBase;
class YandexMetricsCounterSettingsForm extends SystemConfigFormBase {
public function getFormID() {
return 'yandex_metrics_counter_settings';
}
//...
lib/Drupal/yandex_metrics/Form/YandexMetricsCounterSettingsForm.php
— Goodbye, system_settings_form().
Settings form
19
DrupalCamp Kyiv 2013
public function buildForm(array $form, array &$form_state) {
$form['path'] = array(
'#type' => 'details',
'#title' => t('Page specific tracking settings'),
);
// ...
return parent::buildForm($form, $form_state);
}
public function validateForm(array &$form, array &$form_state) { }
public function submitForm(array &$form, array &$form_state) { }
lib/Drupal/yandex_metrics/Form/YandexMetricsCounterSettingsForm.php
Override methods that you need
Configuration & State
20
DrupalCamp Kyiv 2013
Variables (D7)
Configuration (D8)
State (D8)
Configuration files
21
DrupalCamp Kyiv 2013
yandex_metrics.settings:
type: mapping
label: 'Yandex.Metrics Counter settings'
mapping:
counter_code:
type: string
label: 'Counter code'
config/schema/yandex_merics.schema.yml
counter_code: ''
config/yandex_merics.settings.yml
Config & State
22
DrupalCamp Kyiv 2013
// Get config value.
$counter_code = Drupal::config('yandex_metrics.settings')
->get('counter_code');
// Set config value.
Drupal::config('yandex_metrics.settings')
->set('counter_code', $counter_code)->save();
In files
// Get value of state variable.
$value = Drupal::state()->get('some_module.key');
// Set value of state variable.
Drupal::state()->set('some_module.key', $value);
In database
Entities
23
DrupalCamp Kyiv 2013
Fieldable
EntityNG (DX)
Why: deployment, unification
Idea: ctools exportables
Implementation: plugins + yml
new
Content Entities Config Entities
Examples:
Nodes
Taxonomy terms
Users
Comments
Files
Menu Links
…
Examples:
Block instances
Vocabularies
User roles
Views
Menus
Display Modes
Image Styles
…
>
DrupalCamp Kyiv 2013
To be continued…
#D8CX
Kate Marshalkina & Konstantin Komelin
DrupalCamp Kyiv 2013 Continue Here
Upgrade your modules
to Drupal 8
Part 2
Drupal 8 Plugins
26
DrupalCamp Kyiv 2013
Why: extend them all!
Idea: ctools, next generation.
Implementation: classes, annotations.
Examples:
Blocks
Views
Entities
Field Widgets/Formatters
Text Filters
…
That’s not a
“Wordpress” plugin,
guys :)
Block Plugin (theoretical)
27
DrupalCamp Kyiv 2013
Block Plugin (practice)
28
LOREM IPSUM DOLOREM COMPANY Insert You Tagline Here
28
namespace Drupalhello_worldPluginBlock;
Now plugin will be found
automatically!
Block Plugin (practice)
29
DrupalCamp Kyiv 2013
Annotations instead of hook_*_info()
/**
* Provides a 'Random number' block.
*
* @Plugin(
* id = "hello_world_random_number",
* admin_label = @Translation("Random number"),
* module = "hello_world"
* )
*/
class HelloWorldRandomBlock extends BlockBase {
lib/Drupal/hello_world/Plugin/Block/HelloWorldRandomBlock.php
Block Plugin (practice)
30
DrupalCamp Kyiv 2013
Override methods that you need
protected function blockBuild() {
$this->configuration['label'] = t('Random number');
return array(
'#markup' => rand(1, 9),
);
}
//..
public function settings() { }
public function blockForm($form, &$form_state) { }
public function blockSubmit($form, &$form_state) { }
..lib/Drupal/hello_world/Plugin/Block/HelloWorldRandomBlock.php
Block Entities (theoretical)
31
DrupalCamp Kyiv 2013
block.block.bartik.search.yml
block.block.bartik.about_this_site.yml
block.block.bartik.random_number.yml
Block Entities (practice)
32
DrupalCamp Kyiv 2013
sites/default/files/config_#HASH#/active/block.block.bartik.random_number_1.yml
× 2
sites/default/files/config_#HASH#/active/block.block.bartik.random_number_2.yml
sites/default/files/config_#HASH#/active/block.block.bartik.random_number_3.yml
Hooks?
33
DrupalCamp Kyiv 2013
/**
* Implements hook_form_FORM_ID_alter().
*/
function ui_cache_clear_form_block_form_alter(&$form, $form_state)
{
$config_entity = $form_state['controller']->getEntity();
// Fieldset replaced by details.
$form['cache_details'] = array(
'#type' => 'details',
'#title' => t('Cache settings'),
);
// ..
• Hooks are still here.
• And there are new!
ui_cache_clear.module
>
DrupalCamp Kyiv 2013
Views
Visualization API (8.x)
35
DrupalCamp Kyiv 2013
https://drupal.org/sandbox/Niremizov/1985870
Thx Christophe Van Gysel!
Module features:
• Theme hook
• Plugin service (custom
chart handlers)
• Views Style Plugin
Views
36
DrupalCamp Kyiv 2013
• Inside core and already works
• Uses core Plugin System
• Export/Import using Config Entities
• Small API changes
CamelCase
hook_views_api, hook_views_plugin
Tip: How to create default view in Drupal 8:
Copy sitesdefaultfilesconfig_{HASH}activeconfigviews.view.{view_name}.yml
Paste modules{module_name}configviews.view.{view_name}.yml
Views Plugins
37
Drupal 7 Drupal 8
/**
* Implements hook_views_plugins().
*/
function vi..on_views_plugins() {
return array(
'style' => array(
'visualization' => array(
'title' =>
t('Visualization'),
'type' => 'normal',
'theme' => 'visualization',
// ...
'handler' =>
'visualization_plugin_style',
'uses options' => TRUE,
'uses grouping' => FALSE,
/*
* @Plugin(
* id = "visualization",
* title = @Translation("Visualization"),
* display_types = {"normal"}
* theme = "visualization",
* module = "visualization",
* )
*/
class Visualization
extends StylePluginBase {
protected $usesRowClass = TRUE;
protected $usesGrouping = FALSE;
protected $usesFields = TRUE;
// ...
}
DrupalCamp Kyiv 2013
PHPTemplate → Twig
38
DrupalCamp Kyiv 2013
{# core/modules/block/templates/block.html.twig #}
<div{{ attributes }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
<div{{ content_attributes }}>
{{ content }}
</div>
</div>
DrupalCamp Kyiv 2013
KEEP CALM
AND
CLEAR CACHE
And Drupal 8 says:
— “Fatal error: Call to undefined function cache_clear_all()”
Cache System
Cache Tags instead of wildcards
DrupalCamp Kyiv 2013
Cached Item 1
Tag 1
Tag 2
Tag 3
Cached Item 2 Tag 2 Cached Item 3
Tag 1
Tag 3
cache()->invalidateTags(array('Tag 2'));
Cached Item 3
Tag 1
Tag 3
Cached Item 1
Tag 1
Tag 2
Tag 3
Cached Item 2 Tag 2
*
Note: Drupal calculates “checksum” for every cache tag when read from cache!
40
Cache System
41
DrupalCamp Kyiv 2013
// Set cache to 'page' bin.
cache('page')->set($cid, $data, $expire, $tags);
New Cache API
// Truncate cache table.
cache()->deleteAll();
// Marks cache items from all bins with 'content' tag as invalid.
cache_invalidate_tags(array('content' => TRUE));
// Get multiple cache items.
cache('field')->getMultiple($cids);
// Get item even it is invalid.
cache()->get('field:user:1', TRUE);
Automated tests
42
DrupalCamp Kyiv 2013
namespace Drupalyandex_metricsTests;
use DrupalsimpletestWebTestBase;
class CounterTest extends WebTestBase {
public static $modules = array('yandex_metrics');
public static function getInfo() { }
public function setUp() {
parent::setUp();
}
public function tearDown() { }
lib/Drupal/yandex_metrics/Tests/CounterTest.php
Join #D8CX!
Upgrade your module to Drupal 8 or help others!+
DrupalCamp Kyiv 2013
References
44
DrupalCamp Kyiv 2013
• Change records for Drupal core
http://drupal.org/list-changes
• [May 22, 2013] Alex Bronstein (effulgentsia) - Upgrading your modules to
Drupal 8
http://portland2013.drupal.org/session/upgrading-your-modules-drupal-8
• [Feb 8, 2013] Angie Byron (webchick) - Step-by-step: Converting modules
from Drupal 7 to Drupal 8
http://webchick.net/node/118
• [Nov 4, 2012] Tim Plunkett (tim.plunkett) - D8CX: The Reckoning
http://2012.badcamp.net/program/sessions/d8cx-reckoning
!
DrupalCamp Kyiv 2013
Thank you for your attention!
Konstantin Komelin
@KKomelin
konstantin@komelin.com
Kate Marshalkina
@kalabro
marshalkina@licel.ru

Weitere ähnliche Inhalte

Was ist angesagt?

COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8
COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8
COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8Roberto Peruzzo
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5DrupalDay
 
History of Drupal: From Drop 1.0 to Drupal 8
History of Drupal: From Drop 1.0 to Drupal 8History of Drupal: From Drop 1.0 to Drupal 8
History of Drupal: From Drop 1.0 to Drupal 8Websolutions Agency
 
Drupal Migrations in 2018
Drupal Migrations in 2018Drupal Migrations in 2018
Drupal Migrations in 2018Pantheon
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 
Drupal 6 to 7 migration guide
Drupal 6 to 7 migration guideDrupal 6 to 7 migration guide
Drupal 6 to 7 migration guideEbizon
 
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration ManagementExove
 
Drupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonDrupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonMediacurrent
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-BoxSuzanne Dergacheva
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamLuc Bézier
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for DrupalLuc Bézier
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesAcquia
 
Drupal core indeas - Andy Postnikov
Drupal core indeas  - Andy PostnikovDrupal core indeas  - Andy Postnikov
Drupal core indeas - Andy PostnikovDrupalCamp Kyiv
 
[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release partyDrupalDay
 
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
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa InitiativeNuvole
 
Collaborating with the Community
Collaborating with the CommunityCollaborating with the Community
Collaborating with the Communitytinacallahan
 
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017La Drupalera
 

Was ist angesagt? (20)

Migrate to Drupal 8
Migrate to Drupal 8Migrate to Drupal 8
Migrate to Drupal 8
 
COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8
COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8
COSA SIGNIFICA CONVERTIRE UN MODULO DA D7 A D8
 
Drupal in-depth
Drupal in-depthDrupal in-depth
Drupal in-depth
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
 
History of Drupal: From Drop 1.0 to Drupal 8
History of Drupal: From Drop 1.0 to Drupal 8History of Drupal: From Drop 1.0 to Drupal 8
History of Drupal: From Drop 1.0 to Drupal 8
 
Drupal Migrations in 2018
Drupal Migrations in 2018Drupal Migrations in 2018
Drupal Migrations in 2018
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Drupal 6 to 7 migration guide
Drupal 6 to 7 migration guideDrupal 6 to 7 migration guide
Drupal 6 to 7 migration guide
 
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
Drupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonDrupal 8 Vocabulary Lesson
Drupal 8 Vocabulary Lesson
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your team
 
Introduction to Composer for Drupal
Introduction to Composer for DrupalIntroduction to Composer for Drupal
Introduction to Composer for Drupal
 
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 MinutesSpeedrun: Build a Website with Panels, Media, and More in 45 Minutes
Speedrun: Build a Website with Panels, Media, and More in 45 Minutes
 
Drupal core indeas - Andy Postnikov
Drupal core indeas  - Andy PostnikovDrupal core indeas  - Andy Postnikov
Drupal core indeas - Andy Postnikov
 
[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party[drupalday2017] - Devel - D8 release party
[drupalday2017] - Devel - D8 release party
 
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
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
 
Collaborating with the Community
Collaborating with the CommunityCollaborating with the Community
Collaborating with the Community
 
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017
 

Andere mochten auch

Presentation_Final_lowfatmilk
Presentation_Final_lowfatmilkPresentation_Final_lowfatmilk
Presentation_Final_lowfatmilkyuzhou shen
 
Next08 Real-Time Web – What Brands Can Learn from Street Musicans
Next08 Real-Time Web – What Brands Can Learn from Street MusicansNext08 Real-Time Web – What Brands Can Learn from Street Musicans
Next08 Real-Time Web – What Brands Can Learn from Street MusicansBSI
 
Marketing 2.0 – Influence Starts @ Home
Marketing 2.0 – Influence Starts @ HomeMarketing 2.0 – Influence Starts @ Home
Marketing 2.0 – Influence Starts @ HomeBSI
 
Business Case Studies
Business Case StudiesBusiness Case Studies
Business Case Studiesguest78aa88
 
Calvin Crewe, 1933- 2016
Calvin Crewe, 1933- 2016Calvin Crewe, 1933- 2016
Calvin Crewe, 1933- 2016sandyville13
 
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثة
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثةدراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثة
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثةOlfat abd elghany helwa
 

Andere mochten auch (9)

Presentation_Final_lowfatmilk
Presentation_Final_lowfatmilkPresentation_Final_lowfatmilk
Presentation_Final_lowfatmilk
 
Next08 Real-Time Web – What Brands Can Learn from Street Musicans
Next08 Real-Time Web – What Brands Can Learn from Street MusicansNext08 Real-Time Web – What Brands Can Learn from Street Musicans
Next08 Real-Time Web – What Brands Can Learn from Street Musicans
 
139-000675-3
139-000675-3139-000675-3
139-000675-3
 
139-000675-2
139-000675-2139-000675-2
139-000675-2
 
Marketing 2.0 – Influence Starts @ Home
Marketing 2.0 – Influence Starts @ HomeMarketing 2.0 – Influence Starts @ Home
Marketing 2.0 – Influence Starts @ Home
 
Business Case Studies
Business Case StudiesBusiness Case Studies
Business Case Studies
 
Atletismo
Atletismo Atletismo
Atletismo
 
Calvin Crewe, 1933- 2016
Calvin Crewe, 1933- 2016Calvin Crewe, 1933- 2016
Calvin Crewe, 1933- 2016
 
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثة
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثةدراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثة
دراسة تحليلية مقارنة لتأثير دور العمود فى ظل التقنيات الحديثة
 

Ähnlich wie Drupal 8 Contrib Experience: Upgrade your modules to Drupal 8 - Part 2

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
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
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
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsphp2ranjan
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGapAlex S
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationDevelopment Seed
 
Drupal 8: What's new? Anton Shubkin
Drupal 8: What's new? Anton ShubkinDrupal 8: What's new? Anton Shubkin
Drupal 8: What's new? Anton ShubkinADCI Solutions
 
Drupal Recipes: Building Image Galleries with jQuery and Flickr
Drupal Recipes: Building Image Galleries with jQuery and FlickrDrupal Recipes: Building Image Galleries with jQuery and Flickr
Drupal Recipes: Building Image Galleries with jQuery and FlickrBen Shell
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build themDick Olsson
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Siva Epari
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Developmentipsitamishra
 
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 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and moreAcquia
 
Making views - DrupalGov Canberra 2017
Making views - DrupalGov Canberra 2017Making views - DrupalGov Canberra 2017
Making views - DrupalGov Canberra 2017Donna Benjamin
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 

Ähnlich wie Drupal 8 Contrib Experience: Upgrade your modules to Drupal 8 - Part 2 (20)

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
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements 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...
 
Drupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutionsDrupal training-by-ruchiwebsolutions
Drupal training-by-ruchiwebsolutions
 
Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying ConfigurationIBM Drupal Users Group Discussion on Managing and Deploying Configuration
IBM Drupal Users Group Discussion on Managing and Deploying Configuration
 
Drupal 8: What's new? Anton Shubkin
Drupal 8: What's new? Anton ShubkinDrupal 8: What's new? Anton Shubkin
Drupal 8: What's new? Anton Shubkin
 
D7 as D8
D7 as D8D7 as D8
D7 as D8
 
Drupal Recipes: Building Image Galleries with jQuery and Flickr
Drupal Recipes: Building Image Galleries with jQuery and FlickrDrupal Recipes: Building Image Galleries with jQuery and Flickr
Drupal Recipes: Building Image Galleries with jQuery and Flickr
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Drupal distributions - how to build them
Drupal distributions - how to build themDrupal distributions - how to build them
Drupal distributions - how to build them
 
Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010Drupal Module Development - OSI Days 2010
Drupal Module Development - OSI Days 2010
 
Drupal Module Development
Drupal Module DevelopmentDrupal Module Development
Drupal Module Development
 
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 8 improvements for developer productivity php symfony and more
Drupal 8 improvements for developer productivity  php symfony and moreDrupal 8 improvements for developer productivity  php symfony and more
Drupal 8 improvements for developer productivity php symfony and more
 
Overview Of Drupal
Overview Of DrupalOverview Of Drupal
Overview Of Drupal
 
Overview Of Drupal
Overview Of DrupalOverview Of Drupal
Overview Of Drupal
 
Making views - DrupalGov Canberra 2017
Making views - DrupalGov Canberra 2017Making views - DrupalGov Canberra 2017
Making views - DrupalGov Canberra 2017
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 

Mehr von DrupalCamp Kyiv Рысь

система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.DrupalCamp Kyiv Рысь
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity apiDrupalCamp Kyiv Рысь
 
Drupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайтDrupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайтDrupalCamp Kyiv Рысь
 
Cdn hosting решения для drupal (medium)
Cdn hosting   решения для drupal (medium)Cdn hosting   решения для drupal (medium)
Cdn hosting решения для drupal (medium)DrupalCamp Kyiv Рысь
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовDrupalCamp Kyiv Рысь
 

Mehr von DrupalCamp Kyiv Рысь (17)

Drupal association slides us 2013
Drupal association slides us 2013Drupal association slides us 2013
Drupal association slides us 2013
 
Drupal association slides ru
Drupal association slides ruDrupal association slides ru
Drupal association slides ru
 
Game of-sales-presentation
Game of-sales-presentationGame of-sales-presentation
Game of-sales-presentation
 
Backbone js-slides
Backbone js-slidesBackbone js-slides
Backbone js-slides
 
система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.система управления конфигурацией в Drupal 8. анализ результатов изменений.
система управления конфигурацией в Drupal 8. анализ результатов изменений.
 
симфони это не страшно
симфони   это не страшносимфони   это не страшно
симфони это не страшно
 
ознакомления с модулем Entity api
ознакомления с модулем Entity apiознакомления с модулем Entity api
ознакомления с модулем Entity api
 
Services в drupal 8
Services в drupal 8Services в drupal 8
Services в drupal 8
 
Facet api
Facet apiFacet api
Facet api
 
Facet api
Facet apiFacet api
Facet api
 
Erpal erp with drupal
Erpal   erp with drupalErpal   erp with drupal
Erpal erp with drupal
 
Drupal 8 theming principles
Drupal 8 theming principlesDrupal 8 theming principles
Drupal 8 theming principles
 
Drupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайтDrupal 7 и history.js или как ajax инфицировать сайт
Drupal 7 и history.js или как ajax инфицировать сайт
 
Cdn hosting решения для drupal (medium)
Cdn hosting   решения для drupal (medium)Cdn hosting   решения для drupal (medium)
Cdn hosting решения для drupal (medium)
 
Aegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтовAegir. развертывание и управление большой сетью drupal сайтов
Aegir. развертывание и управление большой сетью drupal сайтов
 
Behat
BehatBehat
Behat
 
что нового в мире Services
что нового в мире Servicesчто нового в мире Services
что нового в мире Services
 

Kürzlich hochgeladen

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
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
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
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
 

Kürzlich hochgeladen (20)

Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
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
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
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)
 

Drupal 8 Contrib Experience: Upgrade your modules to Drupal 8 - Part 2

  • 1. #D8CX Kate Marshalkina & Konstantin Komelin DrupalCamp Kyiv 2013 Start Here Upgrade your modules to Drupal 8
  • 2. A Little More About Us 2 DrupalCamp Kyiv 2013 [Moscow, Russia] • UI Cache Clear module author • Contributor to several modules • Web developer at Licel LLC [Saint Petersburg, Russia] • Author of Yandex.Metrics, Pinned Site • Contributor to modules and themes • Co-organizer of Drupal Community in St. Petersburg • Individual web developer, trainer and consultant Kate Marshalkina kalabro Konstantin Komelin KKomelin
  • 3. What is Drupal 8? 3 DrupalCamp Kyiv 2013 Drupal 8 ≠
  • 4. LOREM IPSUM DOLOREM COMPANY Insert You Tagline Here Drupal 8 — Drupal,even better! 4
  • 6. #D8CX: Drupal 8 Contrib Experience • Release top 40 modules together with D8 • 27 modules with #D8CX flag (Jun 8, 2013) • Not only top modules are important! #D8CX: I pledge that UI Cache Clear will have a full Drupal 8 release on the day that Drupal 8 is released. #D8CX: We pledge that Yandex.Metrics will have a full Drupal 8 release on the day that Drupal 8 is released. #D8CX: I pledge that Yandex Services Authorization API will have a full Drupal 8 release on the day that Drupal 8 is released. 6 DrupalCamp Kyiv 2013
  • 7. Why should I upgrade? 7 DrupalCamp Kyiv 2013 • Be one of the first • Prepare to D8 • Learn Drupal 8 API • Help to community and Drupal • Just for fun ;)
  • 8. When should I start? 8 DrupalCamp Kyiv 2013 “In Villabajo they are still drilling the core and don’t have agreements about many things, and in Villarriba others have already upgraded modules” D8 begins Mar 10, 2011 Alpha1 RC Dec, 2013 Beta May 20, 2013 Drupal 8.0 Sep-Oct, 2013 July, 2013
  • 11. UI Cache Clear (7.x) 11 DrupalCamp Kyiv 2013
  • 12. UI Cache Clear (8.x) 12 DrupalCamp Kyiv 2013
  • 13. 13 DrupalCamp Kyiv 2013 New home for sites/all/* Drupal 7 Drupal 8 A new folder structure
  • 14. Before you start 14 DrupalCamp Kyiv 2013 • Update PHP to 5.3.10 • Reconcile to o_OP • Get used to use https://drupal.org/list-changes • Be ready to reinstall Drupal • Prepare your rocket ;)
  • 15. Find 5 differences 15 DrupalCamp Kyiv 2013 Drupal 7 Drupal 8 name = 'Yandex.Metrics Counter' core = 7.x files[] = yandex_metrics.test name: 'Yandex.Metrics Counter' core: 8.x type: module yandex_metrics.info yandex_metrics.info.yml
  • 16. 16 Hurray! We’ve just upgraded the module! Thanks for coming! Goodbye :-P
  • 17. hook_menu and routing 17 DrupalCamp Kyiv 2013 function yandex_metrics_menu() { $items['admin/config/system/yandex_metrics'] = array( 'title' => 'Yandex.Metrics', 'route_name' => 'yandex_metrics_counter_settings', ); // ... } yandex_metrics.moduleStep 2 yandex_metrics_counter_settings: pattern: '/admin/config/system/yandex_metrics' defaults: _form: 'Drupalyandex_metricsFormYandexMetricsCounterSettingsForm' requirements: _permission: 'administer Yandex.Metrics settings' yandex_metrics.routing.ymlStep 1
  • 18. Settings form 18 DrupalCamp Kyiv 2013 namespace Drupalyandex_metricsForm; use DrupalsystemSystemConfigFormBase; class YandexMetricsCounterSettingsForm extends SystemConfigFormBase { public function getFormID() { return 'yandex_metrics_counter_settings'; } //... lib/Drupal/yandex_metrics/Form/YandexMetricsCounterSettingsForm.php — Goodbye, system_settings_form().
  • 19. Settings form 19 DrupalCamp Kyiv 2013 public function buildForm(array $form, array &$form_state) { $form['path'] = array( '#type' => 'details', '#title' => t('Page specific tracking settings'), ); // ... return parent::buildForm($form, $form_state); } public function validateForm(array &$form, array &$form_state) { } public function submitForm(array &$form, array &$form_state) { } lib/Drupal/yandex_metrics/Form/YandexMetricsCounterSettingsForm.php Override methods that you need
  • 20. Configuration & State 20 DrupalCamp Kyiv 2013 Variables (D7) Configuration (D8) State (D8)
  • 21. Configuration files 21 DrupalCamp Kyiv 2013 yandex_metrics.settings: type: mapping label: 'Yandex.Metrics Counter settings' mapping: counter_code: type: string label: 'Counter code' config/schema/yandex_merics.schema.yml counter_code: '' config/yandex_merics.settings.yml
  • 22. Config & State 22 DrupalCamp Kyiv 2013 // Get config value. $counter_code = Drupal::config('yandex_metrics.settings') ->get('counter_code'); // Set config value. Drupal::config('yandex_metrics.settings') ->set('counter_code', $counter_code)->save(); In files // Get value of state variable. $value = Drupal::state()->get('some_module.key'); // Set value of state variable. Drupal::state()->set('some_module.key', $value); In database
  • 23. Entities 23 DrupalCamp Kyiv 2013 Fieldable EntityNG (DX) Why: deployment, unification Idea: ctools exportables Implementation: plugins + yml new Content Entities Config Entities Examples: Nodes Taxonomy terms Users Comments Files Menu Links … Examples: Block instances Vocabularies User roles Views Menus Display Modes Image Styles …
  • 24. > DrupalCamp Kyiv 2013 To be continued…
  • 25. #D8CX Kate Marshalkina & Konstantin Komelin DrupalCamp Kyiv 2013 Continue Here Upgrade your modules to Drupal 8 Part 2
  • 26. Drupal 8 Plugins 26 DrupalCamp Kyiv 2013 Why: extend them all! Idea: ctools, next generation. Implementation: classes, annotations. Examples: Blocks Views Entities Field Widgets/Formatters Text Filters … That’s not a “Wordpress” plugin, guys :)
  • 28. Block Plugin (practice) 28 LOREM IPSUM DOLOREM COMPANY Insert You Tagline Here 28 namespace Drupalhello_worldPluginBlock; Now plugin will be found automatically!
  • 29. Block Plugin (practice) 29 DrupalCamp Kyiv 2013 Annotations instead of hook_*_info() /** * Provides a 'Random number' block. * * @Plugin( * id = "hello_world_random_number", * admin_label = @Translation("Random number"), * module = "hello_world" * ) */ class HelloWorldRandomBlock extends BlockBase { lib/Drupal/hello_world/Plugin/Block/HelloWorldRandomBlock.php
  • 30. Block Plugin (practice) 30 DrupalCamp Kyiv 2013 Override methods that you need protected function blockBuild() { $this->configuration['label'] = t('Random number'); return array( '#markup' => rand(1, 9), ); } //.. public function settings() { } public function blockForm($form, &$form_state) { } public function blockSubmit($form, &$form_state) { } ..lib/Drupal/hello_world/Plugin/Block/HelloWorldRandomBlock.php
  • 31. Block Entities (theoretical) 31 DrupalCamp Kyiv 2013 block.block.bartik.search.yml block.block.bartik.about_this_site.yml block.block.bartik.random_number.yml
  • 32. Block Entities (practice) 32 DrupalCamp Kyiv 2013 sites/default/files/config_#HASH#/active/block.block.bartik.random_number_1.yml × 2 sites/default/files/config_#HASH#/active/block.block.bartik.random_number_2.yml sites/default/files/config_#HASH#/active/block.block.bartik.random_number_3.yml
  • 33. Hooks? 33 DrupalCamp Kyiv 2013 /** * Implements hook_form_FORM_ID_alter(). */ function ui_cache_clear_form_block_form_alter(&$form, $form_state) { $config_entity = $form_state['controller']->getEntity(); // Fieldset replaced by details. $form['cache_details'] = array( '#type' => 'details', '#title' => t('Cache settings'), ); // .. • Hooks are still here. • And there are new! ui_cache_clear.module
  • 35. Visualization API (8.x) 35 DrupalCamp Kyiv 2013 https://drupal.org/sandbox/Niremizov/1985870 Thx Christophe Van Gysel! Module features: • Theme hook • Plugin service (custom chart handlers) • Views Style Plugin
  • 36. Views 36 DrupalCamp Kyiv 2013 • Inside core and already works • Uses core Plugin System • Export/Import using Config Entities • Small API changes CamelCase hook_views_api, hook_views_plugin Tip: How to create default view in Drupal 8: Copy sitesdefaultfilesconfig_{HASH}activeconfigviews.view.{view_name}.yml Paste modules{module_name}configviews.view.{view_name}.yml
  • 37. Views Plugins 37 Drupal 7 Drupal 8 /** * Implements hook_views_plugins(). */ function vi..on_views_plugins() { return array( 'style' => array( 'visualization' => array( 'title' => t('Visualization'), 'type' => 'normal', 'theme' => 'visualization', // ... 'handler' => 'visualization_plugin_style', 'uses options' => TRUE, 'uses grouping' => FALSE, /* * @Plugin( * id = "visualization", * title = @Translation("Visualization"), * display_types = {"normal"} * theme = "visualization", * module = "visualization", * ) */ class Visualization extends StylePluginBase { protected $usesRowClass = TRUE; protected $usesGrouping = FALSE; protected $usesFields = TRUE; // ... } DrupalCamp Kyiv 2013
  • 38. PHPTemplate → Twig 38 DrupalCamp Kyiv 2013 {# core/modules/block/templates/block.html.twig #} <div{{ attributes }}> {{ title_prefix }} {% if label %} <h2{{ title_attributes }}>{{ label }}</h2> {% endif %} {{ title_suffix }} <div{{ content_attributes }}> {{ content }} </div> </div>
  • 39. DrupalCamp Kyiv 2013 KEEP CALM AND CLEAR CACHE And Drupal 8 says: — “Fatal error: Call to undefined function cache_clear_all()”
  • 40. Cache System Cache Tags instead of wildcards DrupalCamp Kyiv 2013 Cached Item 1 Tag 1 Tag 2 Tag 3 Cached Item 2 Tag 2 Cached Item 3 Tag 1 Tag 3 cache()->invalidateTags(array('Tag 2')); Cached Item 3 Tag 1 Tag 3 Cached Item 1 Tag 1 Tag 2 Tag 3 Cached Item 2 Tag 2 * Note: Drupal calculates “checksum” for every cache tag when read from cache! 40
  • 41. Cache System 41 DrupalCamp Kyiv 2013 // Set cache to 'page' bin. cache('page')->set($cid, $data, $expire, $tags); New Cache API // Truncate cache table. cache()->deleteAll(); // Marks cache items from all bins with 'content' tag as invalid. cache_invalidate_tags(array('content' => TRUE)); // Get multiple cache items. cache('field')->getMultiple($cids); // Get item even it is invalid. cache()->get('field:user:1', TRUE);
  • 42. Automated tests 42 DrupalCamp Kyiv 2013 namespace Drupalyandex_metricsTests; use DrupalsimpletestWebTestBase; class CounterTest extends WebTestBase { public static $modules = array('yandex_metrics'); public static function getInfo() { } public function setUp() { parent::setUp(); } public function tearDown() { } lib/Drupal/yandex_metrics/Tests/CounterTest.php
  • 43. Join #D8CX! Upgrade your module to Drupal 8 or help others!+ DrupalCamp Kyiv 2013
  • 44. References 44 DrupalCamp Kyiv 2013 • Change records for Drupal core http://drupal.org/list-changes • [May 22, 2013] Alex Bronstein (effulgentsia) - Upgrading your modules to Drupal 8 http://portland2013.drupal.org/session/upgrading-your-modules-drupal-8 • [Feb 8, 2013] Angie Byron (webchick) - Step-by-step: Converting modules from Drupal 7 to Drupal 8 http://webchick.net/node/118 • [Nov 4, 2012] Tim Plunkett (tim.plunkett) - D8CX: The Reckoning http://2012.badcamp.net/program/sessions/d8cx-reckoning
  • 45. ! DrupalCamp Kyiv 2013 Thank you for your attention! Konstantin Komelin @KKomelin konstantin@komelin.com Kate Marshalkina @kalabro marshalkina@licel.ru