webchick.net

very helpful lioness

Step-by-step: Converting modules from Drupal 7 to Drupal 8

Fri, 02/08/2013 - 01:55 -- webchick

As Gábor pointed out, now's the time to help make Drupal 8 more unified and user/developer friendly. A great way to do that is try porting your modules, now, while there's still time to fix the APIs before code freeze.

Here's the video and slides from my Upgrading your modules to Drupal 8 talk at DrupalCon Sydney 2013, featuring the Pants module.

Slides: PDF | PPT | KEY (the canonical version)

But wait, there's more! ;)

The DrupalCon talk was only an hour, so wasn't nearly long enough to walk through the actual steps involved in each API. However! Thanks to the magic of Git (and particularly git rebase -i ;)), you can actually step through each step in the porting process.


$ git clone --recursive --branch 7.x-1.x http://git.drupal.org/project/pants.git

This will get you the 7.x version of the Pants module so you can look at code that hopefully looks somewhat familiar. :)

From there, you can step through each of the steps as follows:


$ git branch -a
* 7.x-1.x
8.x-01-basics
8.x-02-tests
8.x-03-config
8.x-04-blocks
8.x-05-router
8.x-06-twig
8.x-1.x

$ git checkout 8.x-01-basics
$ git log

Note: Each commit message cross-references the change notification for that particular issue. (They're more granular at the beginning than at the end; sorry. :\)

There's also kind of a "brain-dump" of notes if you want to present these at your local user group: http://drupal.org/node/1911346

Note: This is accurate now, but not necessarily tomorrow or especially not next week. ;) Nevertheless, I hope this is able to help someone out there get involved in Drupal core! :) There's a global sprint happening tomorrow!

Comments

Submitted by Albert Volkman (not verified) on

I think you meant this instead for the git clone-

git clone --recursive --branch 7.x-1.x http://git.drupal.org/project/pants.git

since we don't have your password :)

And, git branch -a to list all non-checked out branches.

Submitted by webchick on

Yes, I most certainly did. Updated the text. Though for future reference, my password is "12345" same as my luggage. ;)

Thanks so much for getting this up so quickly as I'm on the other side of the world.

Glad to see that conversion to D8 isn't going to be too much of a headache after all.

Submitted by apur deshpande (not verified) on

hey i need help regarding managing some static HTML content through drupal. how do i do it!!!????