ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Internet & the Web

Contribute Back to Drupal 8 by Testing Patches Easily

Updated on May 19, 2013

Our Fearless Leader

"Webchick" aka Angie Byron, is an excellent core maintainer who will help you get started in the issue queue.
"Webchick" aka Angie Byron, is an excellent core maintainer who will help you get started in the issue queue. | Source

Community-Driven Software = The Future

In the past, a company such as IBM would make Business Machines for International use. If you were physically there, you made them and contributed. They still do, however...

Today, people from anywhere (with the right tools and some basic knowledge I will let you know) can contribute to systems that will be used by major corporations, sporting teams, top fashion lines, universities, governments and more! Of these Content Management Systems (CMS's, as I will be calling them), one particular that I contribute to is Drupal.

The next version, Drupal8, will be coming out in late 2013. Although programming and such a complex system can feel overwhelming, new people can get started quickly and join in by reviewing patches other people have made. You can progress if you wish to writing patches, themes/templates, then modules/plugins, then distributions if you wish. Later, your friend can say, "I'm looking for information on our state's website", and you can say, "Hey, I contributed to that!" by proxy, or something similar.

Step #1

I will be describing this process by using a MacBook computer. Please search on the internet for instructions if you are using a Windows, Linux, or other operating system because, although I have used them for this, the process is too long to explain in one hub. I am using OSX version 10.7.5 for this hub.

Step #2

Install GIT

Git is a version control system that you might be familiar with if you are a web developer. If you already have it installed -- great! If not, follow the steps listed below on the bottom two links and you will be on to the next step in no time.

https://code.google.com/p/git-osx-installer/

http://git-scm.com/book/en/Getting-Started-Installing-Git


Step #3

Install a local web-server to test with.

Drupal8 is not readily available in the wild yet. If you currently have a website, do not ask your hosting company to install Drupal8 for you until the end of autumn 2013.

Because Drupal8 has higher server requirements than many "entry-level" web hosts at the current moment, I find it easy to get started with a local host than manually installing it on my own website. The main server requirements are PHP 5.3+ and a lot of memory (32mb+ I use 128mb). If you don't know how / can't change these settings, use a local server like MAMP.

Install MAMP by visiting http://www.mamp.info/en/index.html and go through its steps. I recall the install process was pretty painless for Macs. The interface to setup is pretty painless as well. Now you can make websites that only you can visit, which are served from your computer to your computer browser instead of from another computer to your computer browser.

Example #3

MAMP, a website server, locally installed to my laptop computer with PHP   5.3 installed
MAMP, a website server, locally installed to my laptop computer with PHP 5.3 installed | Source

Step #4

Download and install Drupal 8.

At http://drupal.org/node/572834 , you can download the current stable development version of Drupal8. After you click twice on the downloaded zip file, place the folder in the applications -> mamp -> htdocs folder. I will call my folder inside htdocs "drupal8" for simplicity. You can install multiple versions of Drupal for testing and reviewing different issues: an English version, and a Spanish version for example, for testing language issues.

At http://drupal.org/documentation/install/beginners you can find a guide for how to install Drupal.

Step #5

Install Dreditor

Dreditor is a helpful browser extension for Google Chrome for working on Drupal, and is very easy to setup. http://drupal.org/project/dreditor will tell you the simple steps to installing success!


Step #6

Find something to review!

At http://drupal.org/project/issues/search?projects=Drupal+core&status%5B%5D=8 , there were hundreds of issues with patches to review.

Let's select one that we think we can handle. "Multisite themes are not recognized" at http://drupal.org/node/1981112 sounds good to us. Read through the page. The steps to complete the faulty issue are usually at the top, and the patch to fix it is usually at the bottom, highlighted in green, with the text "PASSED: [[SimpleTest]]: "

It passed automated testing, so it won't break our system (most likely). It just needs a human review, and that's where you are needed!

Follow the steps given to find the faulty or missing issue or bug. Take screenshots of the issue and save them for later use. A format I like to name my screenshots is the number of the issue and then words "before" or "after" (before or after applying the patch for review).

Step #7

Download and go "home".

A patch to be tested at the time of this writing was system-fix-theme-enable-1981112-2.patch . Download this file to a location such as the desktop in which you will remember where it is (but NOT in your Drupal location).

After downloading, open up your applications folder in your computer, go to Utilities -> Terminal and open up the Terminal application. This is a text-only command line prompt you may or may not be familiar with, but don't be too scared of it.

Type "ls" to find out your current directory structure. According to the earlier step, the Drupal8 you set up is in Applications -> MAMP -> htdocs -> drupal8 . From the "home" area that my Terminal starts at (Desktop, Documents, Downloads, etc), I type "cd .." and then return/enter, and then "cd .." again. "cd" stands for change directory. On this screen, I see the Applications folder listed. I can change directory to Applications by typing "cd Applications" and then repeat that for MAMP, htdocs, and drupal8. At this point, you should see a list containing core, sites, index.php, etc... I'll call this place "Drupal home" in your Terminal window.

Example of #7

I am applying a patch to review in my "Drupal home" directory in my Terminal application.
I am applying a patch to review in my "Drupal home" directory in my Terminal application. | Source

Step #8

Open up the patch file in some sort of text editor (or just click on the patch in your web browser). The first line will tell you where to apply this patch to.

Here is the example that we have been working with and its first line.

a/core/modules/system/system.admin.inc

From this information, copy your downloaded patch and paste the file into the

"Drupal Home"/core/modules/system/ folder.

"a", or "Drupal home" was explained in the last step.

Switch to your Terminal application and type "git apply " into the command line but do not press return/enter yet. Physically drag the patch file that was copied into your Drupal directory into the Terminal window. It should copy the full patch location there after "git apply ". Now you can press return/enter and see nothing!

If it applied correctly, you will see nothing. If there was an error in applying, you will see the error message. For the purposes of this tutorial, let's say that you saw nothing and therefore the patch applied correctly.

Switch back to your Drupal8 site in Google Chrome and retest the issue. Hopefully, the problem or missing issue will be resolved and work as you feel is normal. Be sure to document through writing what you see during your review, and take screenshots of the "after patch" test.

Step #9

Write up your review.

Note: you don't have to sell anything or "get the issue committed to core Drupal8 today". You just have to tell what you saw, provide screenshots, and let the powers that be make decisions on what they want to do with the information. Hopefully, Dries (founder of Drupal) or some higher up will say, "Good job, this fix or feature is going into core"; but if other people want second opinions or postpone the issue based on other related ones, etc... just keep cruising along and review or re-review some more patches.

Writing the review.

Sign up for an account at drupal.org . Log in to your account at drupal.org . With the Dreditor extension active in your Google Chrome browser, browse to the link that the patch you reviewed is from, scroll down to the bottom, and reply to the original post.

Here is a good sample of an issue post that I have written that has been incorporated into Drupal and the issue closed.

"After applying patch update-normalize-1986616-4.patch from #4 by echoz to a fresh Drupal 8 install, it looks like the normalize library was updated to version 2.1.1.

See screenshots before and after with no perceived detriment in functionality."

Sometimes it is more verbose than this. Be sure to tell what went wrong after the patch applied, if anything, or if the patch did not fix the entire/major issue. Be truthful! I then attached my "before" screenshots, and my "after" screenshots to my reply. Before posting the reply, I embed the screenshots into the post using the "embed" buttons which come from Dreditor.

If you believe that the patch fixed the original issue, and you are done with your review, change the issue status in the drop-down menu below to "reviewed and tested by the community" and submit your post.

Definitive Drupal 7 Book

Step #10

Keep in the Loop

Visit your profile everyday to make sure that the patch author, initiative leader, or just another person in the queue doesn't have questions or a new patch for you.

For more help in the Drupal.org issue queue, users "YesCT" or "craychee" have been very helpful to me and many others. "xjm" or "brantwynn" are also awesome. Chicago represent!

You can bask in the enjoyment that you are contributing, performing useful tasks, making things better, and it might lead to a career if you practicing your development skills as well.

Drupal is a registered trademark of Dries Buytaert.

Overview of Drupal Ladder Step Program by Addison Berry

Ending Open End Poll

What do you feel is the biggest barrier to collaborating to something like Drupal, Wordpress, or others?

See results

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.