Feeds

Author

Nov 07 2018
Nov 07

Last week I attended BADCamp and as usual, I can confirm firsthand that BADCamp keeps being a blast. I will mention some of the reasons why.

The Summits

I had a chance to attend DevOps and Front-end Summits half day each. During such summits, participants shared their experiences about the tools and techniques used regularly while working with clients. While at the DevOps Summit, it was great to hear that a lot of developers are interested in Kubernetes. Also, it was interesting to hear conversations about CI/CD workflows and the different tools used when building disposable instances per PR and deployments per branches which is something we are already working on in weKnow’s client projects.

The sessions

Confident to say that GatsbyJS stole the show. The event included three sessions about GatsbyJS back-to-back and people was eager to learn more about the buzzword:

All the great minds behind the Gatsby presentations at @BADCamp https://t.co/waarKr3uZj pic.twitter.com/iwvGWRayPb

— Gatsby (@gatsbyjs) October 26, 2018

Other recurrent and interesting topics mentioned on different sessions during the event:

  • Design systems and Pattern Lab.
  • The new Drupal Layout Builder.

My session

I had an opportunity to speak at the event. The title of my session was “How To Keep Drupal Relevant In The Git-based and API-driven CMS Era”. Yes, I was presenting one of the sessions related to GatsbyJS. Check out the slides here and feel free to watch the recording as well:

[embedded content]

Feel free to ask any questions using the comment section of this blog post or via twitter mention me directly @jmolivas.

The party

As usual, BADCamp vibes were incredible and the party was great as the event itself and the weKnow team had an amazing time.

badcamp-party

Thank you Platform.sh for sponsoring the event.

The after-party

Well, the first rule of the after-party is not to talk about the after-party. So next year jump into the bus at midnight and join the after-party (only if you want to have fun).

See you at BADCamp 2019 or maybe sooner at DrupalCamp Atlanta 2018

Oct 24 2018
Oct 24

At weKnow, we've been using Gatsby with Drupal for projects lately as our decouple strategy.

We decided to use the same approach for our personal blog sites, and the latest version of this blog was launched using GatsbyJS. What does this mean, We are no longer using Drupal?

Yes, for this site we are no longer using the Drupal theme layer, Twig, theme preprocessing, and the always loved/hated render array. All the frontend was done using ReactJS a modern JS framework.

And no, because Drupal is still used as the backend taking advantage of the JSON-API contributed module.

Why GastbyJS for the frontend?

  • Taking advantage of bleeding edge architecture to deliver a performant website.
  • Turn a content-driven website into a blazing-fast application by pulling data from Drupal and building a site using flat-files.
  • Deploy a site directly to CDN saving headaches and hosting costs.
  • Write all the frontend code using reusable components and a modern framework as React.

How fast is GatsbyJS?

Well after running an audit using lighthouse we obtain the following results.

lighthouse audit

No custom performance tasks are done yet, this is the out-of-the-box performance result by building the site using GatsbyJS.

Why Drupal as the backend?

  • Take advantage of Drupal content model capabilities, creating content types, adding fields, and configuration entities to manage site settings, media management among others.
  • Take advantage of Drupal as a Content Management System, add, edit, draft, publish and schedule content.
  • Take advantage of the acquired knowledge during several years of using the platform.

What were the challenges?

  • Make sure Drupal JSON-API returns markdown to take advantage of the gatsby-transformer-remark plugin.
  • Make sure inline images within markdown are processed using the gatsby-transformer-sharp plugin .
  • Deploy site to a CDN.
  • Execute build and deploy the site on demand and/or programmatically after updating data on Drupal.

Gatsby is taking the world by storm and the JAMstack is here to stay. Join me at my BADCamp session How to keep Drupal relevant in the Git-based and API-driven CMS era, to learn what can we do to keep Drupal relevant and this new era to find out how we solve all those challenges and to learn more about this topic and understand how to decouple the "Content Management" from the “Production Environment".

Feb 19 2018
Feb 19
Download and install Drupal 8.5 and try umami.

By Jesus Manuel OlivasHead of Products | February 19, 2018

By Jesus Manuel OlivasHead of Products | February 19, 2018

If you are following the upcoming release of Drupal 8.5 you might be aware of the umami profile. This installation profile is part of the Out of The Box experience initiative. The goal of this profile is to add sample content presented in a well-designed theme, displayed as a food magazine. Using recipes and feature articles this example site will make Drupal look much better right from the start and help evaluators explore core Drupal concepts like content types, fields, blocks, views, taxonomy, etc.

This profile is committed to the 8.5 branch of the Drupal project repository which makes it a little complicated to try out. To facilitate this I wrote a chain command.

You may think this looks cool but wait ... what this YAML means and what is a chain command?

A chain command is a custom command that helps you automate multiple command execution, allowing you to define and read an external YAML file containing the definition name, options, and arguments of multiple commands and execute that list based on the sequence defined in the file.

For more information about chain commands refer to the Drupal Console documentation.

How do I try this chain command?

In order to try this chain command it is required to have installed on your local system:

What do I need to do?

Copy the content of this gist file to a new file and name it as ~/.console/chain/try-umami-sqlite.yml

How do I execute the new command?

After adding the new file, the `try:umami:sqlite` command will be listed when running the list command. Then you have to execute the command on your local machine

Executing using the interactive mode and answering the interactive question:

drupal try:umami:sqlite

Enter the value for "directory" placeholder:

> /path/to/install/umami/

Executing the command inline and entering the directory where Drupal will be cloned and installed.

drupal try:umami:sqlite --directory=/path/to/install/umami/

Can I use another database as MariaDB, MySQL or other?

Yes, you can. But modifying the downloaded chain file will be required as updating the db-type='mysql' and passing the required options. To review all of the available options for the "site:install" command you can read the DrupalConsole documentation.

Feb 19 2018
Feb 19

If you are following the upcoming release of Drupal 8.5 you might be aware of the umami profile. This installation profile is part of the Out of The Box experience initiative. The goal of this profile is to add sample content presented in a well-designed theme, displayed as a food magazine. Using recipes and feature articles this example site will make Drupal look much better right from the start and help evaluators explore core Drupal concepts like content types, fields, blocks, views, taxonomy, etc.

This profile is committed to the 8.5 branch of the Drupal project repository which makes it a little complicated to try out. To facilitate this I wrote a chain command.

# Requires# - DrupalConsole Launcher# - Git# - Composer# - Sqlite## How to use:# copy the content of this gist to a new file name it as ~/.console/chain/try-umami-sqlite.yml## Execution:# drupal try:umami:sqlite --directory=/path/to/install/umami/## NOTE: Use a full path for directory. Relative paths and `~` character are not allowed.#command: name: try:umami:sqlitedescription: 'Download Drupal 8.5.x and install umami profile using sqlite'commands: # Clone Drupal 8.5.x - command: execarguments: bin: git clone --branch 8.5.x https://git.drupal.org/project/drupal.git {{ directory }}# Download Drupal Console - command: execarguments: bin: composer require drupal/console:~1.0 --working-dir={{ directory }}# Install Drupal - command: execarguments: bin: drupal site:install demo_umami --root={{directory}} --db-type="sqlite" --no-interaction# Start PHP built-in server - command: execarguments: bin: drupal server --root={{directory}}

You may think this looks cool but wait ... what this YAML means and what is a chain command?

A chain command is a custom command that helps you automate multiple command execution, allowing you to define and read an external YAML file containing the definition name, options, and arguments of multiple commands and execute that list based on the sequence defined in the file.

For more information about chain commands refer to the Drupal Console documentation.

How do I try this chain command?

In order to try this chain command it is required to have installed on your local system:

What do I need to do?

Copy the content of this gist file to a new file and name it as ~/.console/chain/try-umami-sqlite.yml

How do I execute the new command?

After adding the new file, the try:umami:sqlite command will be listed when running the list command. Then you have to execute the command on your local machine

Executing using the interactive mode and answering the interactive question:

drupal try:umami:sqlite

Enter the value for "directory" placeholder:

> /path/to/install/umami/

Executing the command inline and entering the directory where Drupal will be cloned and installed.

drupal try:umami:sqlite --directory=/path/to/install/umami/

Can I use another database as MariaDB, MySQL or other?

Yes, you can. But modifying the downloaded chain file will be required as updating the db-type='mysql' and passing the required options. To review all of the available options for the "site:install" command you can read the DrupalConsole documentation.

Jul 18 2017
Jul 18

It feels great to build a Drupal tool that has achieved more than 1 million downloads and helps people from different places around the world to create, build and deploy Drupal applications. It's been quite a journey, which took almost four years and required a lot of time and effort. It’s only fitting that I walk you through my Drupal Console journey.

I hope that taking you through my experience working on the Drupal Console will motivate you become part of a project, collaborate or take the first step. So here are the most important milestones.

The Beginning: The commit that started all

After been organizing a few hangouts and trying to decide to start a contributed project related to Drupal 8, David Flores pushed the first commit to the project repo. It was just a README.md file but every journey, even those that impact many people, start with one single step. That file marked the beginning of Drupal Console.

The Turning Point: Larry Garfield Light Bulb Moment

Everything made more sense at Drupal Camp Costa Rica during a conversation between Larry Garfield, David Flores and I. While talking about Drupal 8 and the recent introduction of Symfony Components, Larry casually mentioned that someone should bring the Symfony console to Drupal 8. That was the light bulb moment!. David and I had been discussing the same topic but had not been writing any code, until that day ... we decided to actually start working on the project.

The Prototype: Drupal Console Receives Warm Welcome

After two months of work and only four commands, we had the chance to present a prototype of the project at BADCamp, during a DrupalizeMe training.

The Demo at the training went so well that we got asked to do the same demo at another session about Drupal 8 module development the next day. This was the moment we realized the project we were trying to build was filling a gap related to writing Drupal 8 modules. Drupal Console started as a scaffolding code generator and that is probably the feature that shines the most because it saves you hours of time trying to figure the code you need to write. But the project evolved into a full CLI with the help of multiple contributors.

The Benefits: Drupal Console Can… Open Doors?

After presenting at NYCCamp I had the chance to talk with Ray Saltini and John DeSalvo from Blink Reaction (now FFW). At that time the Company was looking for a Symfony and Drupal 8 developer to help them train company developers and work on contributing back to the Drupal project. One month later I was hired to work contributing to the Drupal Console project.

Preaching Console: Speaking At Events

The project also led to opportunities to meet thousands of drupalers. Teaching people the benefits and the “how to’s” has become part of the passion. I love hearing how people use the console and how we can make it better.

I have been fortunate enough to spread the word about DrupalConsole by speaking at several DrupalCamp and DrupalCon events at Bogota, Los Angeles, New Orleans, Dublin, and Baltimore. I love teaching people how to use the Drupal Console and if you are interested in having me talking at your event just ping me.

Changing Lives: Drupal Console Creates A New Company

After almost four years working together at the DrupalConsole project and five years of knowing each other. Eduardo Garcia aka enzo pitched me the idea of joining forces with him and Kenny Abarca to rebrand and revamp Anexus IT (one of the most well known development companies in Latin America) and this is how weKnow was born.

I’m glad to share the most recent update on weKnow, we just brought in Omar Aguirre, another Drupal Console co-maintainer, to our team.

Thank you for being an awesome community

None of this could have been possible without the incredible support of the community. It’s amazing how a project we started a few years ago as a Drupal 8 learning exercise, is now considered for the Drupal community a must-have tool to accelerate Drupal 8 development.

Thank you for the first one million downloads, for using the project event with all of the constant changes, for attending talks at events, for providing feedback, creating issues, and sending pull requests, for spreading the word and love about the project sending a tweet, writing a blog post or recording a video, and very special thanks to all of the awesome contributors (you can see them listed here).

Mar 13 2017
Mar 13

By Jesus Manuel OlivasHead of Products | March 13, 2017

By Jesus Manuel OlivasHead of Products | March 13, 2017

I am currently working on a project where we are using DrupalVM as composer dependency.

Since ssh into the VM machine to execute commands could be a little cumbersome, and providing a site configuration file to take advantage of the --target option to execute commands remotely was not an option, because the generate commands can not be executed remotely if you want to use the interactive mode.

My options got narrowed to execute vagrant ssh and run commands within the VM (which I already mentioned I am not a big fan) or take advantage of the vagrant-exec plugin.

I decided to give a try to the vagrant-exec plugin and this what you need to do to use it in your project when DrupalVM is required via composer.

Install plugin

Execute plugin install command.

Plugin configuration

Create or update your config/Vagrantfile.local file with the following configuration:

Execute command using plugin

After this easy steps you can now execute DrupalConsole or any other shell commands against the VM without the need to shh into the machine.

Mar 13 2017
Mar 13

I am currently working on a project where we are using DrupalVM as composer dependency.

Since ssh into the VM machine to execute commands could be a little cumbersome, and providing a site configuration file to take advantage of the --target option to execute commands remotely was not an option, because the generate commands can not be executed remotely if you want to use the interactive mode.

My options got narrowed to execute vagrant ssh and run commands within the VM (which I already mentioned I am not a big fan) or take advantage of the vagrant-exec plugin.

I decided to give a try to the vagrant-exec plugin and this what you need to do to use it in your project when DrupalVM is required via composer.

Install plugin

Execute plugin install command.

vagrant plugin install vagrant-exec

Plugin configuration

Create or update your config/Vagrantfile.local file with the following configuration:

if Vagrant.has_plugin?('vagrant-exec') config.exec.commands '*', directory: '/var/www/drupal' end

Execute command using plugin

vagrant exec bin/drupal generate:module

After this easy steps you can now execute DrupalConsole or any other shell commands against the VM without the need to shh into the machine.

Aug 09 2016
Aug 09

By Jesus Manuel OlivasHead of Products | August 09, 2016

By Jesus Manuel OlivasHead of Products | August 09, 2016

To make the DrupalConsole project more modular and easy to maintain, we are decoupling into separated projects.

As mentioned before the RC-1 release is close with a lot of changes. Stay in touch and feel free to ask any questions by commenting on this post or using the support gitter room https://gitter.im/hechoendrupal/DrupalConsole

Aug 09 2016
Aug 09

To make the DrupalConsole project more modular and easy to maintain, we are decoupling into separated projects.

As mentioned before the RC-1 release is close with a lot of changes. Stay in touch and feel free to ask any questions by commenting on this post or using the support gitter room https://gitter.im/hechoendrupal/DrupalConsole

Apr 24 2016
Apr 24

By Jesus Manuel OlivasHead of Products | April 24, 2016

By Jesus Manuel OlivasHead of Products | April 24, 2016

I published a quick reference guide (cheat sheet) for listing Drupal Console commands. The idea is to build an easy to use reference document, you can view it with modern desktop computer browser and mobile devices.

You can find this project at http://drupalconsole.com/cheatsheet/

The command information you can find on this cheat sheet is the same available commands at http://docs.drupalconsole.com/en/commands/available-commands.html documentation. In both projects, the information is exported from the main Drupal Console project and as you can expect the information within this cheat sheet is multilanguage.

You can fork this project to contribute from https://github.com/hechoendrupal/drupal-console-cheatsheet

NOTE: This project was based on the awesome project https://github.com/Aufree/laravel5-cheatsheet

Apr 24 2016
Apr 24

I published a quick reference guide (cheat sheet) for listing Drupal Console commands. The idea is to build an easy to use reference document, you can view it with modern desktop computer browser and mobile devices.

You can find this project at http://drupalconsole.com/cheatsheet/

The command information you can find on this cheat sheet is the same available commands at http://docs.drupalconsole.com/en/commands/available-commands.html documentation. In both projects, the information is exported from the main Drupal Console project and as you can expect the information within this cheat sheet is multilanguage.

You can fork this project to contribute from https://github.com/hechoendrupal/drupal-console-cheatsheet

NOTE: This project was based on the awesome project https://github.com/Aufree/laravel5-cheatsheet

Feb 04 2016
Feb 04

By Jesus Manuel OlivasHead of Products | February 04, 2016

By Jesus Manuel OlivasHead of Products | February 04, 2016

I am planning to propose a session for DrupalCon New Orleans about Drupal 8 development and Drupal Console and currently looking for session name ideas.

Session abstract text:

Drupal is infamous for its learning curve and drupalisms but Drupal 8 simplifies and standardize the development process, unfortunately this comes with a cost. Drupal 8 is more technically advanced compared to its predecessor and managing the increasing complexity of Drupal 8 could be a daunting task. 

The Drupal Console is a CLI tool that helps you manage that complexity allowing you to generate boilerplate code, interact and debug Drupal 8.

The Drupal Console has been designed to increase productivity making Drupal development and interaction efficient and enjoyable.

Come along as we explore this tool that will help you developing by taking advantage of the modern PHP practices introduced into Drupal 8.

I have been used these names in the past for other DrupalCon events:

  • Introducing the Drupal 8 Console scaffolding module generator - Rejected at Austin.
  • Drupal 8 Console (scaffolding module generator) - Rejected at Amsterdam and accepted at Bogota
  • Speeding up Drupal 8 development using Drupal Console - Accepted at Los Angeles and rejected at Barcelona.
  • Faster and smarter development with Drupal Console - Rejected at Mumbai.

I am trying to figure which session name makes more sense:

  • Faster and Smarter Drupal 8 Development
  • Effective and efficient Drupal 8 Development.
  • Making Drupal development and interaction efficient and enjoyable.

Should I use Drupal Console as part of the session name?

  • Faster and Smarter Drupal 8 Development with Drupal Console.
  • Effective and efficient Drupal 8 Development with Drupal Console.
  • Debugging Drupal 8 with Drupal Console.

Should I add the Drupal Console session to Coding and Development, Symfony or PHP track?

As a Plan B, I will submit other sessions to increase my chance to speak at the event.

  • Writing CLI Commands for Drupal 8.
  • Debugging Drupal 8.
  • Writing a CLI Application using Symfony Components.

Feel free to add any thoughts related to the session abstract and name by commenting on this post.

Feb 04 2016
Feb 04

I am planning to propose a session for DrupalCon New Orleans about Drupal 8 development and Drupal Console and currently looking for session name ideas.

Session abstract text:

Drupal is infamous for its learning curve and drupalisms but Drupal 8 simplifies and standardize the development process, unfortunately this comes with a cost. Drupal 8 is more technically advanced compared to its predecessor and managing the increasing complexity of Drupal 8 could be a daunting task.

The Drupal Console is a CLI tool that helps you manage that complexity allowing you to generate boilerplate code, interact and debug Drupal 8.

The Drupal Console has been designed to increase productivity making Drupal development and interaction efficient and enjoyable.

Come along as we explore this tool that will help you developing by taking advantage of the modern PHP practices introduced into Drupal 8.

I have been used these names in the past for other DrupalCon events:

  • Introducing the Drupal 8 Console scaffolding module generator - Rejected at Austin.
  • Drupal 8 Console (scaffolding module generator) - Rejected at Amsterdam and accepted at Bogota
  • Speeding up Drupal 8 development using Drupal Console - Accepted at Los Angeles and rejected at Barcelona.
  • Faster and smarter development with Drupal Console - Rejected at Mumbai.

I am trying to figure which session name makes more sense:

  • Faster and Smarter Drupal 8 Development
  • Effective and efficient Drupal 8 Development.
  • Making Drupal development and interaction efficient and enjoyable.

Should I use Drupal Console as part of the session name?

  • Faster and Smarter Drupal 8 Development with Drupal Console.
  • Effective and efficient Drupal 8 Development with Drupal Console.
  • Debugging Drupal 8 with Drupal Console.

Should I add the Drupal Console session to Coding and Development, Symfony or PHP track?

As a Plan B, I will submit other sessions to increase my chance to speak at the event.

  • Writing CLI Commands for Drupal 8.
  • Debugging Drupal 8.
  • Writing a CLI Application using Symfony Components.

Feel free to add any thoughts related to the session abstract and name by commenting on this post.

Nov 26 2015
Nov 26

By Jesus Manuel OlivasHead of Products | November 26, 2015

By Jesus Manuel OlivasHead of Products | November 26, 2015

During past BADCamp sprints I was showing some of the latest DrupalConsole features to Mauricio Dinarte.

I was talking about the site:install command, at that time the command only supported MySQL and Mauricio asked several questions related to our plans and upcoming features, one of his questions was about supporting SQLite.

Few days after Mauricio published a blog post about that experience, you can read that post at Disposable Drupal installations with drush.

Two months later and after some work done by Omar Aguirre the SQLite support is now available and with some time on my hands I decide to provide a similar feature on DrupalConsole. The only missing piece was to start the PHP's built in server.

The server command has born.

This is a simple command that can receive an argument and this is an example how to use it.


# Run using default address argument value 127.0.0.1.8088
$ drupal server

# Passing address argument to use a different port number 
$ drupal server 127.0.0.1:8089

# Running default address argument using --root option to define the Drupal root. 
$ drupal --root=/Users/jmolivas/develop/drupal/sites/drupal8.dev server

Drupal Console server command

 

Putting all the pieces together

Once we have the only missing piece into the project I decided to take advantage of the DrupalConsole built-in feature to automate and execute several command and create this YAML file: ~/.console/chain/quick-start.yml


commands:
  - command: site:new
    arguments:
      site-name: drupal8.dev
      version: 8.0.0
  - command: site:install
    options:
        langcode: en
        db-type: sqlite
        db-file: sites/default/files/.ht.sqlite
        site-name: 'Drupal 8 Quick Start'
        site-mail: [email protected]
        account-name: admin
        account-mail: [email protected]
        account-pass: admin
    arguments:
        profile: standard
  - command: server

The previous configuration will execute several commands in this case command that will download Drupal, install it using SQLite and start PHP's built in server you only need to open your browser and point it to 127.0.0.1:8088.

This is how the execution looks like.

Drupal Console chain command quick start

As you can imagine you can take advantage of this to try Drupal 8 quick, use it on sprints, demos and trainings.

You can also make changes on the provided YAML file and add commands to download modules "module:download", install modules "module:install" , import configurations "config:import" and restore your database "database:restore" or any other command provided by DrupalConsole or a custom command by your own module(s).

The server command and the quick-start.yml file will be included on the next release, but if you want to try this feature now you can clone the project for instructions about getting the project you can visit the Getting the project documentation page.

Nov 26 2015
Nov 26

During past BADCamp sprints I was showing some of the latest DrupalConsole features to Mauricio Dinarte.

I was talking about the site:install command, at that time the command only supported MySQL and Mauricio asked several questions related to our plans and upcoming features, one of his questions was about supporting SQLite.

Few days after Mauricio published a blog post about that experience, you can read that post at Disposable Drupal installations with drush.

Two months later and after some work done by Omar Aguirre the SQLite support is now available and with some time on my hands I decide to provide a similar feature on DrupalConsole. The only missing piece was to start the PHP's built in server.

The server command has born.

This is a simple command that can receive an argument and this is an example how to use it.

# Run using default address argument value 127.0.0.1.8088
$ drupal server

# Passing address argument to use a different port number 
$ drupal server 127.0.0.1:8089

# Running default address argument using --root option to define the Drupal root. 
$ drupal --root=/Users/jmolivas/develop/drupal/sites/drupal8.dev server

Drupal Console server command

Putting all the pieces together

Once we have the only missing piece into the project I decided to take advantage of the DrupalConsole built-in feature to automate and execute several command and create this YAML file: ~/.console/chain/quick-start.yml

commands:
  - command: site:new
    arguments:
      site-name: drupal8.dev
      version: 8.0.0
  - command: site:install
    options:
        langcode: en
        db-type: sqlite
        db-file: sites/jmolivas.weknowinc.com/files/.ht.sqlite
        site-name: 'Drupal 8 Quick Start'
        site-mail: [email protected]
        account-name: admin
        account-mail: [email protected]
        account-pass: admin
    arguments:
        profile: standard
  - command: server

The previous configuration will execute several commands in this case command that will download Drupal, install it using SQLite and start PHP's built in server you only need to open your browser and point it to 127.0.0.1:8088.

This is how the execution looks like.

Drupal Console chain command quick start

As you can imagine you can take advantage of this to try Drupal 8 quick, use it on sprints, demos and trainings.

You can also make changes on the provided YAML file and add commands to download modules "module:download", install modules "module:install" , import configurations "config:import" and restore your database "database:restore" or any other command provided by DrupalConsole or a custom command by your own module(s).

The server command and the quick-start.yml file will be included on the next release, but if you want to try this feature now you can clone the project for instructions about getting the project you can visit the Getting the project documentation page.

May 07 2015
May 07

By Jesus Manuel OlivasHead of Products | May 07, 2015

By Jesus Manuel OlivasHead of Products | May 07, 2015

The Drupal Console is a suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

This project takes the Symfony Console component and makes it available on Drupal 8.

The Drupal Console is another cool addition to the Proudly Found Elsewhere school of thought as it leverages the Symfony Console component to handle the CLI part.

A little history

Let’s move back in time to September 2013 at DrupalCamp Costa Rica, where this project was conceived. While David Flores and I were talking with Larry Garfield about Drupal 8. The introduction of Symfony Components had recently happened and at some point, Larry mentioned someone should bring the Symfony Console to Drupal 8.

That was the aha! moment. David and I had been discussing the same topic before, but had been procrastinating until that day when we decided to actually start working on the project.

During the first year of development the project it's been changing from a Drupal 8 module generator to a robust CLI tool for Drupal 8.

The project have commands that interact with the service container. This allows us to do administration task not related to code generation.

Why should you use it?

Managing the increasing complexity of Drupal 8 can be a daunting task for anyone, are you prepared for it?

The Drupal Console is a suite of tools to help you manage that complexity. 

What can you do with it?

  • Generate the code and files required by a Drupal 8 module:

    Drupal Console provides a number of commands for creating module scaffolding and boilerplate code. For any command, you will be asked a series of questions about what you want to generate. 

    Files are generated on the proper directory and inside these files, the proper code is generated for you. Classes area created adding namespaces, uses and also extends and implements keywords when required and adding services using Dependency Injection on class generation.
     

  • Interact with your Drupal installation:

    Drupal Console allows you to interact with your Drupal installation rebulding cache, rebuilding route system, listing/updating/exporting configurations.
     

  • Learning Drupal 8:
    Learn Drupal 8 by generate code using the "--learning" option.

Where can you find the project?

Do you like to know more about Drupal Console join enzo Eduardo García and myself at our DrupalCon Los Angeles session "Speeding up Drupal 8 development using Drupal Console", Thursday, May 14th, 1pm, Room 502B - Lullabot.

May 07 2015
May 07

The Drupal Console is a suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

This project takes the Symfony Console component and makes it available on Drupal 8.

The Drupal Console is another cool addition to the Proudly Found Elsewhere school of thought as it leverages the Symfony Console component to handle the CLI part.

A little history

Let’s move back in time to September 2013 at DrupalCamp Costa Rica, where this project was conceived. While David Flores and I were talking with Larry Garfield about Drupal 8. The introduction of Symfony Components had recently happened and at some point, Larry mentioned someone should bring the Symfony Console to Drupal 8.

That was the aha! moment. David and I had been discussing the same topic before, but had been procrastinating until that day when we decided to actually start working on the project.

During the first year of development the project it's been changing from a Drupal 8 module generator to a robust CLI tool for Drupal 8.

The project have commands that interact with the service container. This allows us to do administration task not related to code generation.

Why should you use it?

Managing the increasing complexity of Drupal 8 can be a daunting task for anyone, are you prepared for it?

The Drupal Console is a suite of tools to help you manage that complexity.

What can you do with it?

  • Generate the code and files required by a Drupal 8 module:

    Drupal Console provides a number of commands for creating module scaffolding and boilerplate code. For any command, you will be asked a series of questions about what you want to generate.

    Files are generated on the proper directory and inside these files, the proper code is generated for you. Classes area created adding namespaces, uses and also extends and implements keywords when required and adding services using Dependency Injection on class generation.

  • Interact with your Drupal installation:

    Drupal Console allows you to interact with your Drupal installation rebulding cache, rebuilding route system, listing/updating/exporting configurations.

  • Learning Drupal 8:
    Learn Drupal 8 by generate code using the "--learning" option.

Where can you find the project?

Do you like to know more about Drupal Console join enzo Eduardo García and myself at our DrupalCon Los Angeles session "Speeding up Drupal 8 development using Drupal Console", Thursday, May 14th, 1pm, Room 502B - Lullabot.

May 01 2015
May 01

By Jesus Manuel OlivasHead of Products | May 01, 2015

By Jesus Manuel OlivasHead of Products | May 01, 2015

I am exited to announce I will be speaking at a DrupalCon Los Angeles, I will be preseting Speeding up Drupal 8 development using Drupal Console on Thursday, May 14th, 1pm, Room 502B - Lullabot.

I will be joining enzo Eduardo García another project co-maintainer, together during this session we will be sharing the insights and latest achievements of the project and mentioning what features are planned for future development.

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more mature CLI tool you can use it to interact with your Drupal 8 installation and can also be used to learn Drupal 8.

Managing the increasing complexity of Drupal 8 can be a daunting task for anyone, are you prepared for it? Drupal Console is a suite of tools to help manage that complexity. Come along as we explore this tool.

If you are involved with Drupal or looking forward to Drupal 8 you don’t want to miss this session.

NOTE: On Monday, May 11th, I will be leading the training Introduction to Symfony2: Getting Ready for D8 If you are attending to DrupalConLA and want to get exposed to writing code for Symfony 2 and Drupal 8 make sure you register for the class now.

Related links:

This is a cross blog post, you can find this at Blink Reaction 

May 01 2015
May 01

I am exited to announce I will be speaking at a DrupalCon Los Angeles, I will be preseting Speeding up Drupal 8 development using Drupal Console on Thursday, May 14th, 1pm, Room 502B - Lullabot.

I will be joining enzo Eduardo García another project co-maintainer, together during this session we will be sharing the insights and latest achievements of the project and mentioning what features are planned for future development.

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more mature CLI tool you can use it to interact with your Drupal 8 installation and can also be used to learn Drupal 8.

Managing the increasing complexity of Drupal 8 can be a daunting task for anyone, are you prepared for it? Drupal Console is a suite of tools to help manage that complexity. Come along as we explore this tool.

If you are involved with Drupal or looking forward to Drupal 8 you don’t want to miss this session.

NOTE: On Monday, May 11th, I will be leading the training Introduction to Symfony2: Getting Ready for D8 If you are attending to DrupalConLA and want to get exposed to writing code for Symfony 2 and Drupal 8 make sure you register for the class now.

Related links:

This is a cross blog post, you can find this at Blink Reaction

Apr 27 2015
Apr 27

By Jesus Manuel OlivasHead of Products | April 27, 2015

By Jesus Manuel OlivasHead of Products | April 27, 2015

DrupalConsole is under heavy development and we are constantly adding new features based on project needs and user feedback.

One of the most recent feature is the capability for commands to call other commands.

The need for it became clear when we were executing commands like "generate:controller" and needed to execute another command by hand such as "router:rebuild" to rebuild the routing system. 

The initial idea was to chain command execution.  In order to do that in code you need to obtain the ChainCommandHelper and call the addCommand method passing the required arguments.

This is the added code to the "generate:controller" command:


$this->getHelper('chain')->addCommand('router:rebuild');

You can take a look at the class helper source code here ChainCommandHelper.php

This is the result of executing the "generate:controller"

As you can see below the generated/updated file list, two messages are showing the routing routing system was rebuilt.

The "chain" command

When that functionality was completed I had a discussion with the other project maintainers and we came up with the idea to create a command that could read a configuration file containing a queue and execute several commands based on the sequence defined in the configuration file.

We decide to use a standard YAML file extension and not go with something like chain extension because we did not want to add a new Drupalism to the project.

I will be recording a video in detail of how to take advantage of this command, in the meantime you can take a look a this demostration of how to use it: 

If interested you can see how the code looks like:

  • Command class source code at ChainCommand file.
  • YAML file containing the commands to be executed at chain.yml file.

How this command can help me?

You can create your own chain command and define the common Drupal 8 features you use while writing a Drupal 8 module and execute one command to have those features generated, as example:


$ drupal chain --file=~/.console/chain/project-start.yml

NOTE: This a partial cross post from BlinkReaction site Drupal Console release 0.7.5

Apr 27 2015
Apr 27

DrupalConsole is under heavy development and we are constantly adding new features based on project needs and user feedback.

One of the most recent feature is the capability for commands to call other commands.

The need for it became clear when we were executing commands like "generate:controller" and needed to execute another command by hand such as "router:rebuild" to rebuild the routing system.

The initial idea was to chain command execution. In order to do that in code you need to obtain the ChainCommandHelper and call the addCommand method passing the required arguments.

This is the added code to the "generate:controller" command:

$this->getHelper('chain')->addCommand('router:rebuild');

You can take a look at the class helper source code here ChainCommandHelper.php

This is the result of executing the "generate:controller"

As you can see below the generated/updated file list, two messages are showing the routing routing system was rebuilt.

The "chain" command

When that functionality was completed I had a discussion with the other project maintainers and we came up with the idea to create a command that could read a configuration file containing a queue and execute several commands based on the sequence defined in the configuration file.

We decide to use a standard YAML file extension and not go with something like chain extension because we did not want to add a new Drupalism to the project.

I will be recording a video in detail of how to take advantage of this command, in the meantime you can take a look a this demostration of how to use it:

If interested you can see how the code looks like:

  • Command class source code at ChainCommand file.
  • YAML file containing the commands to be executed at chain.yml file.

How this command can help me?

You can create your own chain command and define the common Drupal 8 features you use while writing a Drupal 8 module and execute one command to have those features generated, as example:

$ drupal chain --file=~/.console/chain/project-start.yml

NOTE: This a partial cross post from BlinkReaction site Drupal Console release 0.7.5

Mar 08 2015
Mar 08

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more advanced CLI tool you can use it to interact with your Drupal 8 installation, until last week, we used to describe the project as:

A suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

But this project description it's already obsolete, because of two new features:

#1 Verbose code-output.

This new feature will generate code adding extra information to the generated code. Think about this as the commented messages you can find on the examples module code.

How to use it?

You just need to add the --learning option when executing a generator command.

$ drupal generate:controller --learning

As writing this blog post the only command that add a verbose output is the controller generator command generate:controller.

Yes as you just saw, the messages are multi-language, and as long as you change the language on your local configuration file and the message exist on the selected language a message on the selected language will rendered.

If you not see the message on your language, feel free to help us making this tool even better, by fixing current languages or adding more at: http://bit.ly/console-translations.

Why this feature was adedd?

Drupal 8 is more technically advanced compared to its predecessors, writing a module involves a lot of boilerplate code and we want to help developers generating that code. But we do not want them to think this is some sort of black magic.

We started Drupal Console as a side-project with the purpose of learn Drupal 8. And we wanted to provide this learning capabilities but we did not have an idea how to, until receiving a request about adding this feature.

Starting with the latest release 0.7.4 Drupal Console is not longer only a tool to generate code and interact with a Drupal installation.

Drupal Console will help developers to learn Drupal 8 adding messages on the generated code, those messages are in different languages, helping them to learn Drupal 8 on their own language.

#2 GUI web site

I will not provide too many details about this feature, other than Omar Aguirre @omers is currently working to provide a GIU web-site to execute generators and provide a downloadable file containing the generated code.

I will share a couple of images provided by Omar related to this feature.

Once we fully complete these two features, our goal to provide a tool easy to use for everyone even those users not comfortable using the CLI, will be closer to be completed.

For more information related to this project you can try the following links:

- https://drupalize.me/blog/201502/podcast-no-58-drupal-console
- https://www.lullabot.com/blog/podcasts/drupalizeme-podcast/58-drupal-console
- http://jmolivas.com/slides/sandcamp2015/speeding-up-drupal-8-development-using-drupal-console/

If you want to hear about this project at upcoming events:

- http://2015.midcamp.org/session-proposal/speeding-drupal-8-development-using-drupal-console
- https://groups.drupal.org/node/458263

As usual feel free to comment on this post or ping me at @jmolivas or @drupalconsole letting know where do you want to see this messages adding extra information on the generated code when using the --learning option.

Jan 24 2015
Jan 24

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more advanced CLI tool you can use it to interact with your Drupal 8 installation, until last week, we used to describe the project as:

A suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

But this project description it's already obsolete, because of two new features:

#1 Verbose code-output.

This new feature will generate code adding extra information to the generated code. Think about this as the commented messages you can find on the examples module code.

How to use it?

You just need to add the --learning option when executing a generator command.


$ drupal generate:controller --learning

As writing this blog post the only command that add a verbose output is the controller generator command generate:controller.

Yes as you just saw, the messages are multi-language, and as long as you change the language on your local configuration file and the message exist on the selected language a message on the selected language will rendered.

If you not see the message on your language, feel free to help us making this tool even better, by fixing current languages or adding more at: http://bit.ly/console-translations.

Why this feature was adedd?

Drupal 8 is more technically advanced compared to its predecessors, writing a module involves a lot of boilerplate code and we want to help developers generating that code. But we do not want them to think this is some sort of black magic.

We started Drupal Console as a side-project with the purpose of learn Drupal 8. And we wanted to provide this learning capabilities but we did not have an idea how to, until receiving a request about adding this feature.

Starting with the latest release 0.7.4 Drupal Console is not longer only a tool to generate code and interact with a Drupal installation.

Drupal Console will help developers to learn Drupal 8 adding messages on the generated code, those messages are in different languages, helping them to learn Drupal 8 on their own language.

#2 GUI web site

I will not provide too many details about this feature, other than Omar Aguirre @omers is currently working to provide a GIU web-site to execute generators and provide a downloadable file containing the generated code.

I will share a couple of images provided by Omar related to this feature.

Once we fully complete these two features, our goal to provide a tool easy to use for everyone even those users not comfortable using the CLI, will be closer to be completed.

For more information related to this project you can try the following links:

https://drupalize.me/blog/201502/podcast-no-58-drupal-console
https://www.lullabot.com/blog/podcasts/drupalizeme-podcast/58-drupal-console
http://jmolivas.com/slides/sandcamp2015/speeding-up-drupal-8-development-using-drupal-console/

If you want to hear about this project at upcoming events:

http://2015.midcamp.org/session-proposal/speeding-drupal-8-development-using-drupal-console
https://groups.drupal.org/node/458263

As usual feel free to comment on this post or ping me at @jmolivas or @drupalconsole letting know where do you want to see this messages adding extra information on the generated code when using the --learning option.

 

Jan 24 2015
Jan 24

Drupal Console has been evolving a lot since project inception back in 2013 in DrupalCamp Costa Rica.

This projects started as a scaffolding tool, to generate the necessary code to build a Drupal 8 module, and evolved as a more advanced CLI tool you can use it to interact with your Drupal 8 installation, until last week, we used to describe the project as:

A suite of tools that you run on a command line interface (CLI) to generate boilerplate code and interact with a Drupal 8 installation.

But this project description it's already obsolete, because of two new features:

#1 Verbose code-output.

This new feature will generate code adding extra information to the generated code. Think about this as the commented messages you can find on the examples module code.

How to use it?

You just need to add the --learning option when executing a generator command.

$ drupal generate:controller --learning

As writing this blog post the only command that add a verbose output is the controller generator command generate:controller.

Yes as you just saw, the messages are multi-language, and as long as you change the language on your local configuration file and the message exist on the selected language a message on the selected language will rendered.

If you not see the message on your language, feel free to help us making this tool even better, by fixing current languages or adding more at: http://bit.ly/console-translations.

Why this feature was adedd?

Drupal 8 is more technically advanced compared to its predecessors, writing a module involves a lot of boilerplate code and we want to help developers generating that code. But we do not want them to think this is some sort of black magic.

We started Drupal Console as a side-project with the purpose of learn Drupal 8. And we wanted to provide this learning capabilities but we did not have an idea how to, until receiving a request about adding this feature.

Starting with the latest release 0.7.4 Drupal Console is not longer only a tool to generate code and interact with a Drupal installation.

Drupal Console will help developers to learn Drupal 8 adding messages on the generated code, those messages are in different languages, helping them to learn Drupal 8 on their own language.

#2 GUI web site

I will not provide too many details about this feature, other than Omar Aguirre @omers is currently working to provide a GIU web-site to execute generators and provide a downloadable file containing the generated code.

I will share a couple of images provided by Omar related to this feature.

Once we fully complete these two features, our goal to provide a tool easy to use for everyone even those users not comfortable using the CLI, will be closer to be completed.

For more information related to this project you can try the following links:

- https://drupalize.me/blog/201502/podcast-no-58-drupal-console
- https://www.lullabot.com/blog/podcasts/drupalizeme-podcast/58-drupal-console
- http://jmolivas.com/slides/sandcamp2015/speeding-up-drupal-8-development-using-drupal-console/

If you want to hear about this project at upcoming events:

- http://2015.midcamp.org/session-proposal/speeding-drupal-8-development-using-drupal-console
- https://groups.drupal.org/node/458263

As usual feel free to comment on this post or ping me at @jmolivas or @drupalconsole letting know where do you want to see this messages adding extra information on the generated code when using the --learning option.

Jan 21 2015
Jan 21

You can read the first part one of this blog post at Blink Reaction blog site when it get released. For now you can read it at this blog at http://jmolivas.com/2014-a-year-of-contributions

This post was never think as two parts this just happened not sure why. Maybe the original one is taking too long to get published, and I saw and read the text too many times that I end up writing a second part.

2014 was a a year of changes and that was great for me. I started releasing code to an Open Source project the Drupal Console but what does that mean ?.

Releasing code to the public was hard for me. Everyone can see my code and they can see how bad I am as a developer and thus so they can see I suck. Well maybe I am just suffering from impostor syndrome or I am just a bad developer as I see my self.

Getting back in time I realize I did always suffer the same problem. I love music but I was never brave enough to create a band or record my songs, because I was always afraid to show what i created, just because people may said ... that sounds terrible.

The same happened to me related to release code, until one day I decide to contribute to and open source project. After a year I can see was not that bad, and at least some people think the project I am currently working at is useful.

Taking this experience as a catharsis. I decided to release some music this 2015 when and how not sure yet. But I think at some point between conferences and events this year I will invite friends, do some rehearsals, have fun and finally record a few song.

I am also planning to invite people contribute creating music remotly and I am currently looking for tools for remote music collaboration as https://www.ohmstudio.com and http://www.kompoz.com if you know any please let me know. 

I just hope I am not as bad guitar player as a developer, but that will not stop me this time.

Jan 21 2015
Jan 21

You can read the first part one of this blog post at Blink Reaction blog site when it get released. For now you can read it at this blog at http://jmolivas.com/2014-a-year-of-contributions

This post was never think as two parts this just happened not sure why. Maybe the original one is taking too long to get published, and I saw and read the text too many times that I end up writing a second part.

2014 was a a year of changes and that was great for me. I started releasing code to an Open Source project the Drupal Console but what does that mean ?.

Releasing code to the public was hard for me. Everyone can see my code and they can see how bad I am as a developer and thus so they can see I suck. Well maybe I am just suffering from impostor syndrome or I am just a bad developer as I see my self.

Getting back in time I realize I did always suffer the same problem. I love music but I was never brave enough to create a band or record my songs, because I was always afraid to show what i created, just because people may said ... that sounds terrible.

The same happened to me related to release code, until one day I decide to contribute to and open source project. After a year I can see was not that bad, and at least some people think the project I am currently working at is useful.

Taking this experience as a catharsis. I decided to release some music this 2015 when and how not sure yet. But I think at some point between conferences and events this year I will invite friends, do some rehearsals, have fun and finally record a few song.

I am also planning to invite people contribute creating music remotly and I am currently looking for tools for remote music collaboration as https://www.ohmstudio.com and http://www.kompoz.com if you know any please let me know.

I just hope I am not as bad guitar player as a developer, but that will not stop me this time.

Jan 20 2015
Jan 20

If you are following my blog post here, at http://www.blinkreaction.com/drupal-experts-blog, or if  you are reading my twitter timeline https://twitter.com/jmolivas, then you might have some questions about my role and how it works inside a Drupal agency like Blink Reaction.

You might ask, “does this guy do any client work?", "why is he always talking about this Console project?”.

When I was looking back on my contributions to the Drupal community for 2014, I found that my work can directly, at least somewhat, answer those questions.

First here’s why I am so excited about the Console project…

Drupal 8 is more advanced compared to its predecessor and writing a module involves a lot of boilerplate code, there are also a lot of things you need to know and do just to get started with building a new module and these can be repetitive and tedious therefore creating opportunities for errors.

Fortunately, a lot of that code can be generated automatically using a tool called the Drupal Console.

Drupal Console is a project that takes the Symfony Console component and makes it available on Drupal to automatically generate most of the new Drupal 8 module requirements.

This tool not only generates the module code, it also helps you interact with your Drupal installation.

The Drupal Console is another cool addition to the Proudly Found Elsewhere school of thought as it leverages the Symfony Console component to handle the CLI part.

A little history

Let’s move back in time to September 2013 at DrupalCamp Costa Rica, where this project was conceived. While David Flores and I were talking with Larry Garfield about Drupal 8. The introduction of Symfony Components had recently happened and at some point, Larry mentioned someone should bring the Symfony Console to Drupal 8.

That was the aha! moment. David and I had been discussing the same topic before, but had been procrastinating until that day when we decided to actually start working on the project.

At that time in 2013 and almost until the end of the second quarter of 2014, I was working as a Web Developer for the Office of Education in El Centro CA.

I was not doing any Drupal development there, mostly building Symfony2 applications, but since I do have a love-hate-love relationship with Drupal and never left it completely, I keep attending and presenting at conferences and working during my spare time on this Drupal Console as a side project.

Starting in 2014 I decided to send session proposals about the Console project and I had a chance to present at several Drupal Camps:

http://sandcamp.org
http://fldrupal.camp/
http://nyccamp.org/
http://drupalcamp.mx/
http://drupalcamp.cr/
http://2014.tcdrupal.org/
https://2014.drupalcampla.com/
https://2014.badcamp.net/

NYC Camp the one that brought the most changes for me in 2014.

A few weeks before the camp I sent an email to cancel my participation because I did not have any extra days-off at my job and also because flights and hotel costs add up quickly.

Then I got a call from Forest Mars and Molly Byrnes and they helped me make travel arrangements and found me place to stay with another fellow Drupal developer John Robert Wilson.

I’m so glad that everything worked out because the camp was awesome, I did my talk on the Console project, received great feedback and as always learned from fellow Drupalists who were present at the camp.

At that camp I had a chance to meet “Jeffrey A. jam McGuire” who invited me to participate and do my session at the Jam’s Virtual DrupalCamp. You can see the podcast here https://www.acquia.com/resources/podcasts/acquia-podcast-156-j-m-olivas-introducing-drupal-8-console-scaffolding-module-generator

Also at that Camp I had the chance to talk with John DeSalvo and Ray Saltini about Blink Reaction, the Blink Institute and their plans with Symfony and Drupal 8. It turned out those plans fit perfectly with what I was looking for in order to continue my work in the Drupal community. They are giving me that chance by spending time working on Drupal 8 projects.

After almost a month of communication and the interview process I got hired.

What about contributions

Since my main role at Blink Reaction is to contribute back to the community after some talks we agree that I should spend time working on the Drupal Console my side project now became my main activity and also I will get paid for do what I was doing as a hobby.

So far the project is been pretty active as you can see https://www.drupal.org/project/console

While working on the console project I have found and fixed (so far) two Drupal 8 core bugs I did a blog entry related to this topic  http://www.blinkreaction.com/blog/two-drupal-8-core-bugs-found-and-fixed

Also while attending TC Drupal, I had a chance to work with Cathy aka @YesCT and sent patches to another two issues and got the accepted, so far I do have 4 contributions to Drupal 8 Core as you can see on this site http://www.drupalcores.com/. I know just 4 not a big deal right but working on Drupal Core Issues and the contribute space in Drupal is kinda tricky.

What was accomplished for the Drupal Console during 2014.

During the first year of development the project it's been changing from a Drupal 8 module generator to a robust CLI tool for Drupal 8.

The project now have commands that interact with the service container. This allows us to do administration task not related to code generation as listing routes and services from the container and clear Drupal caches.

Keep the project in sync with Drupal 8 changes.

During the development of the console the project have been in synchronization with the development branch of Drupal 8.

This make sense at the beginning of the project when Drupal 8 was in Alpha state.

Since DrupalCon Amsterdam Drupal Beta 01 version has been released for testing and feedback and after some discussion with David Flores the other co-maintainer of the project we decide to keep the project in synchronization with Drupal Beta releases.

More information and full blog post http://jmolivas.com/the-drupal-8-console-will-sync-drupal-8-beta-releases

Provide an installer and executable phar file.

One of the most recurring questions since project started is why is the installation process modifying the composer.json & composer.lock file, or why is the installer adding new libraries to "core/vendor" directory, because you know that is considered hacking the core.

More information and full blog post http://jmolivas.com/try-the-new-drupal-console-installer-and-executable-phar-file

Install Drupal Console globally.

This change provide the feature of accessing the console.phar from anywhere on your system, using a global installation as composer or drush does.

I will list a few points why this new global executable is important for the life cycle and roadmap of the Drupal Console project:

* Add a new self-update command to make easy update to new releases
* Work on the documentation, since installation process will probably not change
* Add a new set of command like site:install
* Take advantage of site aliases
* Work on the issue related to Integrate console with drush
* Add console commands to wrap drush commands

More information and full blog post:
http://jmolivas.com/install-drupal-console-globally

DrupalCon Amsterdam 2014 Drupal Lightning Talk presentation

For the first time ever DrupalCon Amsterdam replaced the third day keynote with lightning talks in the main auditorium. I sent my proposal in and was lucky to be selected. I shared details about the project I have been more involved in lately The Drupal 8 Console. Take a look at my presentation slides here. If you have any other questions on this project, let me know!

Check out the reactions on Twitter related to this presentation here: Storify - Drupal 8 Console DrupalCon Amsterdam Lightning Talk

I've also put together a list of blog posts and other reactions about this project: https://gist.github.com/jmolivas/3c12bc53708fdadfa3f7

NOTE: This is a cross-blog-post that will be published at Blink Reaction web site.

Jan 20 2015
Jan 20

If you are following my blog post here, at http://www.blinkreaction.com/drupal-experts-blog, or if you are reading my twitter timeline https://twitter.com/jmolivas, then you might have some questions about my role and how it works inside a Drupal agency like Blink Reaction.

You might ask, “does this guy do any client work?", "why is he always talking about this Console project?”.

When I was looking back on my contributions to the Drupal community for 2014, I found that my work can directly, at least somewhat, answer those questions.

First here’s why I am so excited about the Console project…

Drupal 8 is more advanced compared to its predecessor and writing a module involves a lot of boilerplate code, there are also a lot of things you need to know and do just to get started with building a new module and these can be repetitive and tedious therefore creating opportunities for errors.

Fortunately, a lot of that code can be generated automatically using a tool called the Drupal Console.

Drupal Console is a project that takes the Symfony Console component and makes it available on Drupal to automatically generate most of the new Drupal 8 module requirements.

This tool not only generates the module code, it also helps you interact with your Drupal installation.

The Drupal Console is another cool addition to the Proudly Found Elsewhere school of thought as it leverages the Symfony Console component to handle the CLI part.

A little history

Let’s move back in time to September 2013 at DrupalCamp Costa Rica, where this project was conceived. While David Flores and I were talking with Larry Garfield about Drupal 8. The introduction of Symfony Components had recently happened and at some point, Larry mentioned someone should bring the Symfony Console to Drupal 8.

That was the aha! moment. David and I had been discussing the same topic before, but had been procrastinating until that day when we decided to actually start working on the project.

At that time in 2013 and almost until the end of the second quarter of 2014, I was working as a Web Developer for the Office of Education in El Centro CA.

I was not doing any Drupal development there, mostly building Symfony2 applications, but since I do have a love-hate-love relationship with Drupal and never left it completely, I keep attending and presenting at conferences and working during my spare time on this Drupal Console as a side project.

Starting in 2014 I decided to send session proposals about the Console project and I had a chance to present at several Drupal Camps:

* http://sandcamp.org
* http://fldrupal.camp/
* http://nyccamp.org/
* http://drupalcamp.mx/
* http://drupalcamp.cr/
* http://2014.tcdrupal.org/
* https://2014.drupalcampla.com/
* https://2014.badcamp.net/

NYC Camp the one that brought the most changes for me in 2014.

A few weeks before the camp I sent an email to cancel my participation because I did not have any extra days-off at my job and also because flights and hotel costs add up quickly.

Then I got a call from Forest Mars and Molly Byrnes and they helped me make travel arrangements and found me place to stay with another fellow Drupal developer John Robert Wilson.

I’m so glad that everything worked out because the camp was awesome, I did my talk on the Console project, received great feedback and as always learned from fellow Drupalists who were present at the camp.

At that camp I had a chance to meet “Jeffrey A. jam McGuire” who invited me to participate and do my session at the Jam’s Virtual DrupalCamp. You can see the podcast here https://www.acquia.com/resources/podcasts/acquia-podcast-156-j-m-olivas-introducing-drupal-8-console-scaffolding-module-generator

Also at that Camp I had the chance to talk with John DeSalvo and Ray Saltini about Blink Reaction, the Blink Institute and their plans with Symfony and Drupal 8. It turned out those plans fit perfectly with what I was looking for in order to continue my work in the Drupal community. They are giving me that chance by spending time working on Drupal 8 projects.

After almost a month of communication and the interview process I got hired.

What about contributions

Since my main role at Blink Reaction is to contribute back to the community after some talks we agree that I should spend time working on the Drupal Console my side project now became my main activity and also I will get paid for do what I was doing as a hobby.

So far the project is been pretty active as you can see https://www.drupal.org/project/console

While working on the console project I have found and fixed (so far) two Drupal 8 core bugs I did a blog entry related to this topic http://www.blinkreaction.com/blog/two-drupal-8-core-bugs-found-and-fixed

Also while attending TC Drupal, I had a chance to work with Cathy aka @YesCT and sent patches to another two issues and got the accepted, so far I do have 4 contributions to Drupal 8 Core as you can see on this site http://www.drupalcores.com/. I know just 4 not a big deal right but working on Drupal Core Issues and the contribute space in Drupal is kinda tricky.

What was accomplished for the Drupal Console during 2014.

During the first year of development the project it's been changing from a Drupal 8 module generator to a robust CLI tool for Drupal 8.

The project now have commands that interact with the service container. This allows us to do administration task not related to code generation as listing routes and services from the container and clear Drupal caches.

Keep the project in sync with Drupal 8 changes.

During the development of the console the project have been in synchronization with the development branch of Drupal 8.

This make sense at the beginning of the project when Drupal 8 was in Alpha state.

Since DrupalCon Amsterdam Drupal Beta 01 version has been released for testing and feedback and after some discussion with David Flores the other co-maintainer of the project we decide to keep the project in synchronization with Drupal Beta releases.

More information and full blog post http://jmolivas.com/the-drupal-8-console-will-sync-drupal-8-beta-releases

Provide an installer and executable phar file.

One of the most recurring questions since project started is why is the installation process modifying the composer.json & composer.lock file, or why is the installer adding new libraries to "core/vendor" directory, because you know that is considered hacking the core.

More information and full blog post http://jmolivas.com/try-the-new-drupal-console-installer-and-executable-phar-file

Install Drupal Console globally.

This change provide the feature of accessing the console.phar from anywhere on your system, using a global installation as composer or drush does.

I will list a few points why this new global executable is important for the life cycle and roadmap of the Drupal Console project:

* Add a new self-update command to make easy update to new releases
* Work on the documentation, since installation process will probably not change
* Add a new set of command like site:install
* Take advantage of site aliases
* Work on the issue related to Integrate console with drush
* Add console commands to wrap drush commands

More information and full blog post:
http://jmolivas.com/install-drupal-console-globally

DrupalCon Amsterdam 2014 Drupal Lightning Talk presentation

For the first time ever DrupalCon Amsterdam replaced the third day keynote with lightning talks in the main auditorium. I sent my proposal in and was lucky to be selected. I shared details about the project I have been more involved in lately The Drupal 8 Console. Take a look at my presentation slides here. If you have any other questions on this project, let me know!

Check out the reactions on Twitter related to this presentation here: Storify - Drupal 8 Console DrupalCon Amsterdam Lightning Talk

I've also put together a list of blog posts and other reactions about this project: https://gist.github.com/jmolivas/3c12bc53708fdadfa3f7

NOTE: This is a cross-blog-post that will be published at Blink Reaction web site.

Jan 14 2015
Jan 14

A new release was published today v0.6.2 this new release include bug fixes and new features that I will mention in this blog post.

Support for new field types on form generation

Add support for select, radio, textarea & checkbox fields in form generator. Thanks to Eduardo García aka @enzo for this feature.  

Add multilingual support for generated module commands

Since Drupal modules already have a config directory, the decision to store custom module command translations was adding a new directory and file at that path as example:


my_module\config\translation\console.en.yml # for english 
my_module\config\translation\console.es.yml # for spanish 

Self update command

This command update a phar install with the latest version. Thanks to David Flores aka @dmose for this feature.


$ drupal self-update

Plugin REST resource generator

This command generates a new plugin resource class. Thanks to Eduardo García aka @enzo for this feature.  


$ drupal generate:plugin:rest:resource

How to used the new generated REST resource 

1. Download and Enable Rest UI module https://www.drupal.org/project/restui (git version)
2. Enable resource at http://example.com/admin/config/services/rest select format and authentication provider
3. Enable the Rest Resource permission to access by role at http://example.com/admin/people/permissions

If you need more information about this topic, I receomend you to read this blog post from enzo http://enzolutions.com/articles/2014/12/16/how-to-create-a-rest-resource-in-drupal-8/

New place for documentation

We moved the Drupal Console documentation to gitbook http://hechoendrupal.gitbooks.io/drupal-console/ 

Feel free to fork and contribute at the ducumentation repository at github https://github.com/hechoendrupal/drupal-console-book

Jan 14 2015
Jan 14

A new release was published today v0.6.2 this new release include bug fixes and new features that I will mention in this blog post.

Support for new field types on form generation

Add support for select, radio, textarea & checkbox fields in form generator. Thanks to Eduardo García aka @enzo for this feature.

Add multilingual support for generated module commands

Since Drupal modules already have a config directory, the decision to store custom module command translations was adding a new directory and file at that path as example:

my_module\config\translation\console.en.yml # for english 
my_module\config\translation\console.es.yml # for spanish 

Self update command

This command update a phar install with the latest version. Thanks to David Flores aka @dmose for this feature.

$ drupal self-update

Plugin REST resource generator

This command generates a new plugin resource class. Thanks to Eduardo García aka @enzo for this feature.

$ drupal generate:plugin:rest:resource

How to used the new generated REST resource

  1. Download and Enable Rest UI module https://www.drupal.org/project/restui (git version)
  2. Enable resource at http://example.com/admin/config/services/rest select format and authentication provider
  3. Enable the Rest Resource permission to access by role at http://example.com/admin/people/permissions

If you need more information about this topic, I receomend you to read this blog post from enzo http://enzolutions.com/articles/2014/12/16/how-to-create-a-rest-resource-in-drupal-8/

New place for documentation

We moved the Drupal Console documentation to gitbook <http://hechoendrupal.gitbooks.io/drupal-console/ >

Feel free to fork and contribute at the ducumentation repository at github https://github.com/hechoendrupal/drupal-console-book

Jan 06 2015
Jan 06

We are getting close hope by the end of this week, to a code-freeze on the development of this project, this code-freeze will be for about 4 weeks, in order to have time to work on the project documentation and prepare with David Flores aka @dmouse to present this project at DrupalCon Latino.

The first goal to complete before this code-freeze was add multilingual capabilities to the project, but why?, I can list a few reasons.

  • Drupal is multilingual and Drupal 8 is even more than ever, you can take a look a the D8MI at http://www.drupal8multilingual.org/ and we want to ship this project with similar capabilities.
  • It feels good and more natural to use a tool on your mother tongue, and by the way most of our project contributors are not native english speakers.
  • Separate messages from code will ease the text messages updates, no need to know/learn PHP or use an IDE to contribute.
  • We (David Flores & myself) will be presenting a sesion in Spanish, related to this project at the DrupalCon Latino in Bogota, and at some point we decide making project multilingual will be interesting for the event audience.

As I mentioned on twitter:

Code look a little hacky but got a translatable version of #Drupal Console commands, feature will be available on the next release. #drupal8

— Jesus Manuel Olivas (@jmolivas) January 2, 2015

But wee need a starting point.

Talking about code, this is what was required

Adding the Symfony Translation Component to the composer.json file

"require": {
    ...
+   "symfony/config": "2.6.*",
+   "symfony/translation": "2.6.*",
    ...
},

For more information about the Translation Component look the awesome symfony documentation here.

Add translation files and messages

# extract of config/translations/console.en.yml
command:
  cache:
    rebuild:
      description: Rebuild and clear all site caches.
      options:
        cache: Only clean a specific cache.
      messages:
        welcome: Welcome to the cache:rebuild command.
        rebuild: Rebuilding cache(s), wait a moment please.
        completed: Done cleaning cache(s).
        invalid_cache: Cache "%s" is invalid.
      questions:
        cache: Select cache.

Actually four languages files are available (en, es, fr and pt) you can find those files here, take note those files are only a copy of the console.en.yml file with few overrides for testing purposes.

Create a new Helper class

In order to take care of the translation the TranslatorHelper class was added see code here, the Helper was also registered at bin/conosle.php see code here

Inject the TranslatorHelper

For this task was necessary to modify the RegisterCommandsHelper class, obtaining the TranslatorHelper and Injecting via the constructor when creating and registering a new instance of each command.

if ($cmd->getConstructor()->getNumberOfRequiredParameters()>0) {
  $translator = $this->getHelperSet()->get('translator');
  $command = $cmd->newInstance($translator);
}
else {
  $command = $cmd->newInstance();
}
$this->console->add($command);

You can see the full class here

How can you help

Feel free to take a look at the messages at the github repo and send us fixes.

How to override the default language

As simple as creating a new YAML file at your home directory ~/.console/config.yml and override the language value.

#file path ~/.console/config.yml
application:
  language: es

How to make a console.phar

We are using and recommend this great project http://box-project.org/

$ curl -LSs https://box-project.github.io/box2/installer.php | php
$ mv box.phar /usr/local/bin/box

// Run this inside your project directory to create a new console.phar file
$ box build

Feel free to try this new multilingual feature on the latest release v0.6.0, and as usual feel free to ask any questions commenting on this page, or adding a new issue on the drupal project page or the github repository.

Dec 31 2014
Dec 31

As I mentioned on a previous post, one of the most recurring questions (the 2nd most to be precise) since project started is why is the installation process modifying the composer.json & composer.lock file, or why is the installer adding new libraries to "core/vendor" directory, because you know that is considered hacking the core.

And as you may know that is no longer an issue, since we release an installer you can read about on the Try the new Drupal Console installer and executable phar file

This new installer generates a new issue and question, why this executable must live inside the Drupal installation, why not accessing the console.phar from anywhere on your system, why not having a global instalation as composer or drush does.

After some code refactoring, I am happy to announce we have a new release v0.5.0 with several improvements and fixes and starting on this version we can provide this global execution feature on the Drupal Console project.

How does this change the current installation process?. I will describe it here:

Executing the installer:

//Run this in your terminal to get the latest Console version:
$ curl -LSs http://drupalconsole.com/installer | php
          
// Or if you don't have curl:
$ php -r "readfile('http://drupalconsole.com/installer');" | php

Accessing console from anywhere on your system:

To access console globally move the executable 'console.phar' to a directory that is already in your PATH.

// Run this in your terminal to get the latest Console version:
$ mv console.phar /usr/local/bin/drupal
// Depends of the rights of your user you have to user sudo command to execute the mv

// use the project
drupal generate:module

You can see how easy is to run the installation process and execute the console globally on the following animated gif:

Repeating the same exercise and putting all the pieces together as in the previous installer post. I will to show how to create a Drupal 8 module in 3 easy steps:

How to create a #drupal8 module 1 curl -LSs http://t.co/bZ7shWL4PO | php 2 mv console.phar /usr/local/bin/drupal 3 drupal generate:module

— Jesus Manuel Olivas (@jmolivas) December 23, 2014

Are you interested and what was changed, you can also take a look at the [Pull Request](https://github.com/hechoendrupal/DrupalAppConsole/pull/256/files)

What is next ?, why having this global executable is important ?

I will list a few points why this new global executable is important for the lifecycle and roadmap of the Drupal Console project:

* Add a new self-update command to make easy update to new releases
* Work on the documentation, since installation process will probably not change
* Add a new set of command like site:install
* Take advantage of site aliases
* Work on this issue Integrate console with drush
* Add console commands to wrap drush commands

Feel free to try the project new installer instructions and global executable file, and as usual feel free to ask any questions commenting on this page, or adding a new issue on the drupal project page or the github repository.

Dec 17 2014
Dec 17

After a couple of sprints and few weeks doing client work, I am back on contribute mode, and I am using my time to make sure the Drupal Console is in sync with the latest Drupal 8 Beta 4 release.

Disclaimer: Before this update, the Drupal Console was in sync with Beta 2 and maybe some of the changes I will mention here are related to Beta 3.

In order to keep track of the required changes I add an issue on the github repository:

https://github.com/hechoendrupal/DrupalAppConsole/issues/238

The only command with issues was the controller generator

After running the generate:controller command and try loading the page I found the following issues:

Issue: 'Page not found' message when loading '/demo/hello/Drupal'

Fix: _content is no longer a valid keyword on the routing definition _controller must be used instead.

  # old generated code
  _content: '\Drupal\demo\Controller\DefaultController::hello'

  # new generated code
  _controller: '\Drupal\demo\Controller\DefaultController::hello'

If interested you can see the commit fixing this issue.

I also take a look at the documentation and update the An introductory example to Drupal 8 routes and controllers documentation page to reflect this change.

After changing route definition a new error show up.

Issue: 'Not Acceptable' error message and a blank page.

Fix: A Controller method not longer accept String as return value, must return either a renderable array or a Response Object.

  // old generated code
  return 'Hello '.$name.'!';

  // new generated code
  return [
    '#type' => 'markup',
    '#markup' => $this->t('Hello @name!', ['@name' => $name])
  ];

If interested you can see the commit fixing this issue.

Awesome just a few fixes and the Drupal Console is in sync with the latest Drupal 8 Beta 4 and we have a release v0.3.1 for the project.

Feel free to try this project, you can find installing instructions on my previous post Try the new Drupal Console installer and executable phar file and as usual feel free to ask any questions commenting on this page, or adding a new issue on the drupal project page or the github repository.

Dec 09 2014
Dec 09

Little more than a month since my last blog post, where I do announced The Drupal 8 Console will sync Drupal 8 Beta releases and we are still in in sync with Beta 2 even when Drupal is Beta 03, but we have been working the project and I will share what is new:

The new landing page

The drupal console have a new landing page http://drupalconsole.com/ this is an external site outside of the drupal project page and the github repository, we plan to use this a comunication channel for any news related to the project.

At now this is only a plain HTML site, but we are working with Omar Aguirre one of the project co-maintainers to convert this to a Drupal 8 site. I will keep you informed.

The new installer

One of the most recurring questions since project started is why is the installation process modifying the composer.json & composer.lock file, or why is the installer adding new libraries to "core/vendor" directory, because you know that is considered hacking the core.

The new installation steps

//Change to Drupal 8 installation root directory
$ cd path/to/drupal8.dev

// Run curl in your terminal:
$ curl -LSs http://drupalconsole.com/installer | php
          
// Or if you don't have curl:
$ php -r "readfile('http://drupalconsole.com/installer');" | php

When using the new installer method, we are no longer modifying the composer.json & composer.lock files or adding extra libraries to "core/vendor" directory.

The new executable phar file

Before showing you how to execute the console.phar lets try to undestand what is a phar file, based on the official php documentation

Phar archives are best characterized as a convenient way to group several files into a single file. As such, a phar archive provides a way to distribute a complete PHP application in a single file and run it from that file without the need to extract it to disk. Additionally, phar archives can be executed by PHP as easily as any other file, both on the commandline and from a web server. Phar is kind of like a thumb drive for PHP applications.

How to execute the console.phar file:

//Use the console.phar 
$ php console.phar

You can see how easy is to run the installation process and execute the console.phar file on the following animated gif (I am using this image format because is vintage and cool).

Putting all the pieces together, and as I mentioned on twitter a few days ago. I will show you how to create a Drupal 8 module in 4 easy steps:

How to create a #drupal8 module: 1 cd path/to/drupal8 2 curl -LSs http://t.co/R2TX2VxyPC | php 3 php console.phar generate:module 4 profit

— Jesus Manuel Olivas (@jmolivas) November 26, 2014

I want to thank people for maintaining the blogs and pages where I found some links mentioning the console project:

Feel fee to try the new installer and console executable phar file and make sure you let us know any inconvenience, error messages or recommendations commenting on this page, or adding a new issue on the drupal project page or the github repository.

Nov 01 2014
Nov 01

During the development of the console the project have been in syncronization with the development branch of Drupal 8.

This make sense at the begining of the project when Drupal 8 was in Alpha state.

Since DrupalCon Amsterdam Drupal Beta 01 version has been released for testing and feedback and after some discussion with David Flores the other co-maintainer of the project we decide to keep the project in syncronization with Drupal Beta releases.

The current release of Drupal 8 is Beta 02.

What does this mean to the development of the project ?

Related to code changes this was an easy step just an update the composer.json file.

...
-    "twig/twig": "1.16.*",
+    "twig/twig": "1.15.*",
...
   },
    "require-dev": {
...
-   "drupal/drupal": "8.0.x-dev",
+   "drupal/drupal": "8.0.0-beta2",
...
   },
...

Why are we doing this ?

Make easier for anyone trying to test the console project, since they do not need to keep in sync with every single release and use a bleeding edge version of Drupal 8.

Install Drupal 8 using drush in order to try the Console project

$ drush dl drupal-8.0.0-beta2
$ mv drupal-8.0.0-beta2 drupal8.dev
$ drush si standard --db-url=mysql://root:[email protected]/drupal 
  --site-name=drupal8.dev --account-name=admin --account-pass=admin 
  [email protected] -y

Install Drupal 8 Console using composer

$ COMPOSER_BIN_DIR=bin composer require --dev drupal/console:@stable
$ bin/console
Oct 15 2014
Oct 15

Thanks to my current employer Blink Reaction sponsoring some of my working hours, I will be able to spend more time as co-maintainer of the Drupal 8 Console project by the way David Flores (@dmouse) is the other co-maintainer of the project.

What is the Drupal 8 Console

The Drupal 8 Console it is an effort to bring the The Console Component to Drupal 8 as you can see on the project description .

The purpose of this project is to leverage the Symfony Console Component to provide a CLI tool to automate the creation of drupal 8 modules and other recurring tasks.

Where can you find more information about this project?

You can see my latest presentation at DrupalCon Amsterdam 2014 Drupal Lightning Talks.

[embedded content]

And read some twitter reaction related to this presentation at the following link:

https://storify.com/jmolivas/drupal8-console-drupalcon-amsterdam-lightning-talk

Also read some blog post related to DrupalCon mentionning the project:

Other blog posts mentioning the Console project:

Time for a few questions

We are currently working on the road map and milestones definition and interested to get the more feedback the better. Now I will ask you for a few minutes of your time to answer the following questions on the comment section of this blog post.

  • Do you know about the Console project ?
  • Have you tried the Console project before ?
  • If yes, What do you like about it and what not what will you change ?
  • Which features you will like to see in a CLI tool for Drupal 8 besides what is out of the box right now ?

Photo by Josef Dabernig @dasjo, original image at google+

Oct 07 2014
Oct 07

Looking at the DrupalCon Latinamerica 2015 web site. I just find out no training day offered for the event which somehow is kinda disappointing, since even the local-community events have been offering a full free training day during several DrupalCamps. I can recall at least during this year DrupalCamp Mexico, DrupalCamp Costa Rica and DrupalCamp Centro América.

So I decided to send a tweet with my concern about this topic and did make sure I copy to the main players on the organization of this event: @drupalcon, @drupalconlatino and @DrupalAssoc. You can RT and Reply with your comment here or see my question:

Hi @drupalcon, why no training day for @drupalconlatino ?. A couple of free trainings may increase interest of attendance cc: @DrupalAssoc

— Jesus Manuel Olivas (@jmolivas) October 7, 2014

As you can see a reply was sent by Holly Ross @drupalhross this was the answer:

@jmolivas Sorry Jesus. We just don’t have the budget for it this time. @drupalcon @drupalconlatino @DrupalAssoc

— Holly Ross (@drupalhross) October 7, 2014

Sounds pretty valid right, without money there is not much the DA can do.

Looking at the program, the first day is almost free of activities other than Registration & Open Reception.

Monday - 9 February 2015
Registration Opens
Opening Reception

If the issue is related to budget, what can we do as a community to help and make a free full training day happen during the event ?.

How about take advantage of a few community members which already are spending their time & money in order to assist the event and asking if they are interested in provide free trainings for the attendees. I can bet that more than a few of us will be more than happy to propose a free training session.

Would not that be wonderful the Drupal community giving back to the community, is not that one of the main goals of this brotherhood.

I will put my effort and time where my mouth is and this is my training proposal for the event.

Full-day (6 to 8 hrs) free training proposals by the commmunity:

  • "Introduction to Symfony2 & Drupal 8" by David Flores & Jesus Manuel Olivas
  • "Views and Panels" by Jorge Ram & Joaquín Bravo (Axai)
  • "Drupal for designers", "Drupal site building for designers" or "Information Architecture for drupal" by Alberto Rojas (Manatí)
  • "Beginner and/or advanced Drupal" by Joeri Poesen (Code Enigma)
  • "Sass 101, from the ground up" by José David Leiva
  • "Test-Driven Drupal: TDD & BDD in Your Drupal Workflow" or "Community-Building in a Big, Diverse Open Source World" by Miguel Hernandez
  • "Best Practices for Building Drupal Sites on a Managed Platform: Git Magic, Continuous Integration, and Configuration in Code (CMI)" by Matt Cheney (Pantheon)
  • "Headless Drupal" by Omar Aguirre or Victor Kane
  • "The Absolute Beginners Guide to Drupal" by Steve (ostraining)
  • "What is Drupal?" - Atenea
  • "Multilingual site building, alternatives available and best practices (for D7)" by Alberto Arancibia

Feel free to add a comment on this post either you think it is or not a good idea or any other concern this causes.

I will update the list based on the proposal if any is added as a comment.

NOTE: WTF stands for What The Failure ... yeah right.

UPDATES:
We are sharing a document to control Trainings, Sponsors, Venues & Volunteers, feel free to add your name at any of the lists.

DrupalCon - Community Trainings spreadsheet

Related links:

Jun 26 2014
Jun 26

Based on requirements of a couple projects that I am currently working on, I was in the need to create a content entity type in Drupal 8, and as usual I decided to go ahead and do what every developer does, RTFM and follow the steps as shown on the official documentation.

I was lucky enough to found a link related to my task “Creating a content entity type in Drupal 8” on the official documentation but since code on a project at Alpha state changes a lot the documentation was not up to date, it means the official documentation is the code and as you can guess I faced some challenges that I will list below and the approach I used to overcome it.

While creating this blog post the documentation was update so you can see the original documentation I was reading when started writing this blog post https://www.drupal.org/node/2192175/revisions/7222609/view the only change so far is the migration from PSR-0 to PSR-4 as you can see it here https://www.drupal.org/node/2192175/revisions/7382233/view

Copy source code from documentation

First task was to copy all the source code from the documentation and this was the result

foo_bar/
├── README.md
├── foo_bar.info.yml
├── foo_bar.install
├── foo_bar.local_actions.yml
├── foo_bar.local_tasks.yml
├── foo_bar.module
├── foo_bar.routing.yml
└── lib
    └── Drupal
        └── foo_bar
            ├── Entity
            │   ├── Controller
            │   │   └── FooBarListBuilder.php
            │   ├── FooBar.php
            │   └── Form
            │       ├── FooBarDeleteForm.php
            │       ├── FooBarFormController.php
            │       └── FooBarSettingsForm.php
            └── FooBarInterface.php

6 directories, 13 files

Source code at github https://github.com/jmolivas/foo_bar/tree/1-source-code-from-documentation

Update to PSR-4

As you can see the directory structure is based on PSR-0 but Drupal modules must be PSR-4 so I updated with the following result.

foo_bar/
├── README.md
├── foo_bar.info.yml
├── foo_bar.install
├── foo_bar.local_actions.yml
├── foo_bar.local_tasks.yml
├── foo_bar.module
├── foo_bar.routing.yml
└── src
    ├── Entity
    │   ├── Controller
    │   │   └── FooBarListBuilder.php
    │   ├── FooBar.php
    │   └── Form
    │       ├── FooBarDeleteForm.php
    │       ├── FooBarFormController.php
    │       └── FooBarSettingsForm.php
    └── FooBarInterface.php

4 directories, 13 files

Source code at github https://github.com/jmolivas/foo_bar/tree/2-update-to-psr-4

The "foo_bar" entity type did not specify a list_builder class

After installing the module and trying to visit the route "foo-bar/list" the following error was triggered.

Uncaught PHP Exception Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: 
"The "foo_bar" entity type did not specify a list_builder class." at 
/core/lib/Drupal/Core/Entity/EntityManager.php line 293

Fix: Replace on "src/Entity/FooBar.php" class at the plugin controllers declaration "list" with "list_builder" and since "FooBarListController" class does not exist, point it to the correct class "FooBarListBuilder"

- "list" = "Drupal\foo_bar\Entity\Controller\FooBarListController",
+ "list_builder" = "Drupal\foo_bar\Entity\Controller\FooBarListBuilder",

After this changes the route "foo-bar/list" was properly working

Source code at github https://github.com/jmolivas/foo_bar/tree/3-list-builder

ContentEntityFormController class not found

When trying to add new content using the follwing route "foo-bar/add" the following error was triggered

PHP Fatal error:  Class 'Drupal\Core\Entity\ContentEntityFormController' 
not found in /modules/foo_bar/src/Entity/Form/FooBarFormController.php 
on line 12

Fix: "ContentEntityFormController" class not longer exist it was repalced with "ContentEntityForm" then the next step was to replace it on "FooBarFormController" class

-use Drupal\Core\Entity\ContentEntityFormController;
+use Drupal\Core\Entity\ContentEntityForm;

-class FooBarFormController extends ContentEntityFormController {
+class FooBarFormController extends ContentEntityForm {

After this changes the route "foo-bar/add" was properly working

Source code at github https://github.com/jmolivas/foo_bar/tree/4-ContentEntityFormController-class-not-found

Integrity constraint violation: 1048 Column "type" cannot be null

When trying to save the values in the form and click save the following error was triggered

Uncaught PHP Exception Drupal\Core\Entity\EntityStorageException: 
"SQLSTATE[23000]: Integrity constraint violation: 
1048 Column 'type' cannot be null

Fix: Set "type" form field default value as Entity Type Id at "form" method on "FooBarFormController" class

+ $form['type'] = array(
+   '#type' => 'hidden',
+   '#default_value' => $entity->getEntityTypeId(),
+ );

Source code at github https://github.com/jmolivas/foo_bar/tree/5-integrity-constraint-violation

Call to a member function toRenderArray() on a non-object

When trying to delete any content using "foo-bar/{id}/delete" the following error was triggered

PHP Fatal error:  Call to a member function toRenderArray() 
on a non-object in /core/lib/Drupal/Core/Form/ConfirmFormHelper.php 
on line 44

Fix: Return an URL object on getCancelRoute method at "FooBarDeleteForm" Class

+use Drupal\Core\Url;

- return array(
-   'route_name' => 'foo_bar.list',
- );
+ return new Url('foo_bar.list');

After this changes the route "foo-bar/{id}/delete" was properly working and I was able to delete content

Source code at github https://github.com/jmolivas/foo_bar/tree/6-call-to-member-function-on-non-object

Update the documentation

Finally after the code was properly working you can get the latest version at this github repository https://github.com/jmolivas/foo_bar

I decide to update the documentation with the generated code, you can see the updated version here https://www.drupal.org/node/2192175/revisions/7382931/view

Feel free to send any corrections, improvements or comments related to the new code.

Jun 23 2014
Jun 23

I want to share a series of blog posts I wrote on the Blink Reaction site, on these articles I shared some ideas about what's comming on Drupal 8, Symfony components and other concepts related to modern PHP development that are going to be part of "The New Drupal Way".

Hopefully after reading those articles have yourself interested to try Drupal 8, even when is still on alpha state.

If you want to try Drupal 8 without worrying about configuring your local environment you may use the following online services:

If you want to try Drupal 8 in your local environment then you may try using a Drupal 8 ready Virtual Machine:

Feel free to add a comment if there is any other online services or Virtual Machine to try Drupal 8.

Image credit blink reaction site: http://www.blinkreaction.com/blog/build-it-with-drupal-8

May 07 2014
May 07

The following code here was an exercise I was working on, my goal was to load a template and a CSS asset file from a Controller in Drupal 8.

As you can see here, in my first iteration I was over engineering the solution as I explain on the next points.

- Implement ContainerInjectionInterface Class in order to be able of injecting the Container.
- Inject the container using create method.
- Extract the Twig service from the service container using __construct method.
- Load the Twig template file manually & render passing the name argument manually.
- Build an array and use drupal_render() function at hello method return.

<?php 
namespace Drupal\acme\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Template\TwigEnvironment;

class DefaultController extends ControllerBase implements ContainerInjectionInterface 
{
  /**
  * @var Drupal\Core\Template\TwigEnvironment
  */
  protected $twig;

  public function __construct(TwigEnvironment $twig)
  {
    $this->twig = $twig;
  }

  public static function create(ContainerInterface $container)
  {
    return new static(
      $container->get('twig')
    );
  }

  /**
   * hello
   * @param  string $name
   * @return string
   */
  public function hello($name) 
  {

    $template = $this->twig->loadTemplate(
      drupal_get_path('module', 'acme') . '/templates/hello.html.twig'
    );

    $markup = [
      '#markup' => $template->render([ 'name' => $name ]),
      '#attached' => [ 'css' => [
          drupal_get_path('module', 'acme') . '/assets/css/acme.css'
        ]
      ]
    ];

    return drupal_render($markup);
  }
}

That piece of code works but I was not happy neither proud of it, so I decided to ask what other developers think about it, you can see my question at Drupal Answers StackExchange

Based on one of the answers, recovering my Drupal 7 memories and spending a few minutes reading the documentation about hook_theme/8 I did the following code refactorization.

Add the acme_theme function to acme.module file

<?php 

  function acme_theme() {
    $theme['hello_page'] = [
      'variables' => ['name' => NULL],
      'template' => 'hello',
    ];

    return $theme;
  }

Remove several lines of code from DefaultController.php class with this result

<?php 

namespace Drupal\acme\Controller;

use Drupal\Core\Controller\ControllerBase;

class DefaultController extends ControllerBase 
{

  /**
   * hello
   * @param  string $name
   * @return string
   */
  public function hello($name) 
  {
    return [
      '#theme' => 'hello_page',
      '#name' => $name,
      '#attached' => [ 
        'css' => [
          drupal_get_path('module', 'acme') . '/assets/css/acme.css'
        ]
      ]
    ];
  }
}

If interested, you can see a gist containing all of the files and code at this link:
https://gist.github.com/jmolivas/d29065493a91f16f35b2

If want to see the revisions and code changes try this link:
https://gist.github.com/jmolivas/d29065493a91f16f35b2/revisions

Pages

About Drupal Sun

Drupal Sun is an Evolving Web project. It allows you to:

  • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
  • Facet based on tags, author, or feed
  • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
  • View the entire article text inline, or in the context of the site where it was created

See the blog post at Evolving Web

Evolving Web