Home / Drupal Global Sprint Weekend - Contribute to Drupal 8

Drupal Global Sprint Weekend - Contribute to Drupal 8

During the Drupal Global Sprint Weekend, local code sprints will be held over the weekend of January 17, 2015. The Drupal Global Sprint Weekend will focus on Drupal core, but as Drupal 8 becomes more polished, there's also plenty to be done in the world of contributed modules. Helping to port a module to D8 is a great way to get involved while learning what's new.

Why Contrib?

Historically, when a new major version of Drupal is released, it has taken a while for contrib modules to catch up with stable releases. This can cause delays in building and launching new Drupal 8 sites. Now that D8 is in beta (8.0.0-beta4 was released on December 17!) and the APIs are pretty stable, it's a perfect time to work on porting existing modules to D8. It's also a good way to learn about some of the changes in Drupal development.

Find a Project

You can search the Modules page on drupal.org for active projects with existing D8 releases. From there, you can browse the issue queue for any project, and filter on the version field to view only the 8.x issues.

If the issue queue contains bug reports, try installing the module and replicating the bug. If there is a proposed patch that addresses the issue, review the patch to see if it fixes the bug. Post back to the issue queue to confirm whether you are able to replicate or not, or whether you require more information in order to replicate. If you are testing a patch be sure to report whether it resolves the bug.

Change Records

Any API changes in Drupal 8 that break backwards compatibility now require documentation of in the form of a change record. These change records can serve as detailed and focused how-tos for you to upgrade your skills and get started with what's new/different in Drupal 8.

For example, consider hook_permission() in Drupal 7, which is used to define user permissions. You might be surprised to discover that this hook is absent from Drupal 8, but a quick search of the change records returns documentation on how permissions are now implemented in YAML files:

There are even code examples, where applicable, to help you update your Drupal 8 code:

Drupal 7

<?php
 
// in views. module file.

 
function views_permission() {
   
$permissions = array(
     
'access all views' => array(
       
'title' => t('Bypass views access control'),
       
'description' => t('Bypass access control when accessing views.'),
      ),
    );

    return
$permissions;
  }
?>

Drupal 8

# In views.permissions.yml file.
access all views:
    title: 'Bypass views access control'
    description: 'Bypass access control when accessing views.'
    restrict access: TRUE

Drupal Module Upgrader

The Drupal Module Upgrader is a set of drush commands that can serve to simplify the process of upgrading a module from Drupal 7 to Drupal 8. If you are just starting to port an existing module to D8, you should definitely check out this project.

The Drupal Module Upgrader provides two helpful commands:

  • The drush dmu-analyze command will scan the files in a Drupal 7 module and flag code that needs to be updated, with links to documentation of relevant API changes. This output is saved to a static HTML file for easy reference.
  • The drush dmu-upgrade command will actually attempt to automate the process of upgrading a Drupal 7 module to Drupal 8. Although this process is by no means comprehensive and you're unlikely to produce a fully-functioning module just by running it through this tool, it reduces some of the tedium of rewriting the code, and also provides helpful inline comments for code that needs more thorough inspection.

When upgrading existing modules, especially when running drush dmu-upgrade, remember to Git clone the repository locally so you can easily diff your code to see what's been changed.

D7 Contrib

There's no better time to get acquainted with Drupal 8 than at a sprint, where you have other Drupalists available to answer questions and bounce ideas off of. However, if there's an existing D7 project that interests you, this is also an opportunity to work on D7 contrib as well.

The Drupal Global Sprint 2015 - New England will be held on Saturday, January 17 from 10am to 5pm. RSVP now to join us at Genuine in Boston, or find a local code sprint to participate in.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

Filtered HTML

  • Use [acphone_sales], [acphone_sales_text], [acphone_support], [acphone_international], [acphone_devcloud], [acphone_extra1] and [acphone_extra2] as placeholders for Acquia phone numbers. Add class "acquia-phones-link" to wrapper element to make number a link.
  • To post pieces of code, surround them with <code>...</code> tags. For PHP code, you can use <?php ... ?>, which will also colour it based on syntax.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <h4> <h5> <h2> <img>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.