Thursday, June 6, 2013

First Patch for Drupal 8.x

W
hew! Now that everything is set up, I'm back to the dev env page to get my first patch down, in, tested and confirmed. Hopefully I can get this done before someone else jumps on it. I kind of wish there was a check-out system for issues– oh I see, they're assigned, got it. So, here's my first issue for patch review: Remove drupal_add_css() from book.module.

Actually, step one: blink, get glass of water. Thanks to Jesse for plucking out a nice easy issue for me to start with and being so encouraging about my progress. 
  1. Apply the patch: 
    • First, git pull in Drupal directory. Sigh, right, of course. Configure again. Argh, so now my settings.php file wont write itself. Whelp, no idea what that was about, but I fixed it by creating a new default folder. I think the permissions had gotten screwed up on the previous, probably my own doing? Ok, wiped the entire thing, re-installed, re-db'd, reconnected. 
    • Pull down latest version of the patch. Finally found more detailed instructions on where to download the patch to here, 'cause I wanted to be sure. Went for "curl http://drupal.org/files/[patch-name].patch | git apply -" Didn't get any errors, so that seems to have worked. 
    • Run git diff to see changes... shiny, looks just like the view from the issue tracker. Will have to figure out how to use git diff a bit later. Note to self: make list of things to do "a bit later."
    • hm, but if I look at the module code, I'm not seeing the second addition from the patch. ohoh, duh, because that's a deletion, not an addition. Right!
  2. Enable the book module: Well that was easy, yay. This is, I'm a little sheepish to admit, my first time looking at the inside of a Drupal install. But look, the extend tab, logically, is modules, right? And then I just click this handy checkbox... The super easy, obvious UI is making me so happy. 
  3. Put some articles into a book: Articles, or book pages? I'll do some of both. 
  4. Verify that book.theme.css is still loading: tested by a) inspecting elements with Chrome dev tools, and b) using jQuery to find specific selectors in the dev tools console. Seems to work fine. Yay!
  5. Set the issue to "Reviewed and Tested by the Community" or "RTBC": Done. Wrote a nice, hopefully brief enough comment detailing my steps and mentioning the error I got for an unrelated (I think) issue. [Any issues I work will be recorded on my Drupal.org profile (you have to have an account to see my profile, but this issue is here).]
That should be it for now. I'll have to go find another issue to work on next! Well, right after I know that last one went ok. And maybe do a little more reading on patches and contributions and things. 

No comments:

Post a Comment