Some easy first core patches for some lucky someones!

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
You are viewing a wiki page. You are welcome to join the group and then edit it. Be bold!

Your mission, should you choose to accept it, is to help Drupal 5 be even more awesome by checking it over for places where it doesn't conform to the Coding standards, and rolling patches to fix them. This gets even easier when you use a module called Coder which will check this out for you!

By fixing the errors that Coder module finds, and making a patch, you can get your very own first patch in core, thus launching your illustrious Drupal ninja career!

Read on to find out how!!

NOTE: As you're going through this "virgin patch-roller eyes," PLEASE make note of anywhere where the documentation was unclear and/or your needed help figuring something out. You can either post issues to the Documentation issue queue and one of the docs team members will try and get it sorted -- or! band together with your fellow neophytes and come up with the ultimate "patching Drupal from a newbie's perspective" guide.

Step 0: Do a search for "Code style clean-up" to get a current list of modules that have/need patches.

Step 1: Install the "HEAD" version of Drupal, which will become Drupal 5 very shortly. The best way to do this is with CVS, as that will give you the absolutely newest, freshest code. But you can also download a 5.x-dev snapshot which gets packaged a few times a day.

Step 2: Enable ALL core modules.

Step 3: Install the Coder Coder module, and go to Administer >> Code review.

Step 4: Where it finds an error, go into that line in the file (assuming it doesn't already have a patch -- refer to step 0) and change it to what it should be. So for example,

Line 335: Arrays should be formatted with a space separating each element and assignment operator

        '#type'=>'fieldset',

That line should actually read (note the spaces):

        '#type' => 'fieldset',

or:

Line 496: string concatenation should be formatted with a space separating the operators (dot .) and terms ('string')

        $info->screenshot = dirname($info->filename) . '/screenshot.png';

That line should be (don't put a space between a dot and a quote):

        $info->screenshot = dirname($info->filename) .'/screenshot.png';

Repeat until it says "No Problems Found" for that module.

If you find something weird, where Coder module is suggesting a problem where you really don't think there is one, or you think of a neat feature that could make Coder module even cooler, submit bugs or feature requests to its issue queue (though remember to search first to make sure it hasn't already been submitted).

Step 5: Now that the module file has its changes in place, it's time to roll a patch! You can find Windows-specific info at Creating patches with Windows.

Step 6: Post the patch to Drupal's issue queue. Here are the values you should put in:

  • Project: Drupal
  • Version: 5.x-dev
  • Component: something.module
  • Category: bug report
  • Priority: minor
  • Status: code (needs review)
  • Title: Code style clean-up: something.module
  • Description: Here are some coding standards errors caught by Coder module

Step 7: Find one of your fellow Dojo-ites and ask him or her to review the patch... that means they'll apply the patch and test it to make sure it doesn't break anything, and make sure that all the errors are fixed. If so, then they will post a reply to your issue, and change the Status to patch (ready to be committed). If there's a problem, they can either re-create the patch, or can mark it patch (code needs work).

Step 8: Wait patiently to see if Dries, Steven, or drumm Commit your patch to Drupal! If so, you've just got your first patch in core! :D

Comments

Update!

webchick's picture

add1sun went to town and rolled patches for all of these. However! A lot of these need to be re-rolled, so it's not too late to learn how to patch! Pick any of the following:

Please make sure you're rolling patches according to the instructions at http://drupal.org/patch... just using regular old 'diff' doesn't quite cut it.

Btw, it would be cool if the folks who already know how to patch would leave these for the ones who don't... they're all pretty good "low-hanging fruit" and work well as gentle introductions to rolling patches. I'll continue to post any other "easy" patches I see here for folks.

Another update

add1sun's picture

The patches have been rolled (I got really good at both code standards and patch rolling by redoing all of them) but they still need to be reviewed so if folks could put to practice applying patches and make sure the newer ones work, that would be cool.

Also, NOTE that the help.module patch has been set to patch(code needs work). Webchick has an explanation of why on the issue and I'm going to leave it alone so someone else can try their hand rolling the fixes so please have at it!

Learn Drupal online at Drupalize.me