Reviewing code using Dreditor — an easy way to start contributing to Drupal

Parent Feed: 
Original Post: 

A user script isn't a Drupal module, but a piece of JavaScript that is executed on certain sites or pages where it alters the code. There are user scripts for enhancing the look and use of Google, YouTube, Facebook — you name it! Even NodeOne's been using a script that injects a block with in-house notes on drupal.org project pages. In the case with Dreditor, it injects a very handy review button and editor wherever there's a .patch file attatchment in the Drupal issue queues.

Chrome has user script support out of the box nowadays, but Firefox doesn't, so if you're going to use Firefox for this you'll first need to install the Greasemonkey extension.

With user script support installed, go to the Dreditor project page and click the 'Click to Install or Update' link.

In Firefox you'll then see this dialog box:

1.png

Hit 'Install'.

If you're on Chrome, the file (dreditor.user.js) will be downloaded to you default downloads folder. To install it, open the Extension window (Window > Extensions), drag the file from the download bar (or from the downloads folder) into it, and hit 'Add' in the dialog box that pops up.

Now you're ready to do some reviewing!

First, search the Drupal core issue queue for issues with the 'needs review' status. If you're just starting out, a hot insider tip from dixon_ is to use the advanced search functionality to restrict the search to issues tagged with 'Novice'. You can also further restrict the search results to issues about a certain component of core — for instance the comment module, the Bartik theme, or the documentation.

2.png

Then click the summary (title) of an issue that interests you, and scroll down the page for that issue until you see the latest patch as a file attatchment.

This is what the file attachment will look like without the Dreditor script ...

3.png

... and this is what it will look like with it installed.

4.png

Hit the 'REVIEW' button to opened the patch code in Dreditor!

5.png

If you spot an error in the code, select that part of the text. It will be highlighted and an input box will pop up on the left side. In it, write your comments about that part of the text and hit 'Save'. If you find other errors, repeat. When you're done, hit 'Paste'. You'll be taken back to the issue page with your notes nicely formatted and filled into the comment form and the issue status automatically changed from 'needs review' to 'needs work'.

6.png

Hit 'Preview' to see what it will look like when posted ...

7.png

... and then hit 'Save' to post it!

That's all there's to it!

Reviewing other people's code is a great way to learn how Drupal works on the inside. You don't even have to spot an error to post a review — a comment like 'everything looks okay' will be just as helpful.

If you need a further kick in the butt to get started with contributing, join one of the DrupalCon Munich sprints on Friday! For instance, there's the core sprint in the Ballsaal from 9 am to 5 pm, and also Drupalize.me is going to host a Contribution Workshop from 9 to 12 am (location to be announced). Tomorrow Thursday at 2:15 pm in the Montreal room there will be a BoF called Prep for Core Sprinters: Drupal 8 development environment configuration. Go there if you need help getting your environment in order for the core sprint.

There's also a good guide on code contribution at drupal.org/novice.

Oh, and a last word: If you're an advanced user and spot a Drupal bug that would be easy to fix, consider just posting an issue about it and tagging it with 'Novice' to let someone else have a go at it.