Monday 19 December 2016

Finish Drupal Ladder [Drupal Core Ladder] - Test patches

Finish Drupal Ladder [Drupal Core Ladder] - Test patches



INTRODUCTION


Laptop on which installation was performed: HP Windows 10.
To be able to use Ubuntu ,I used a virtualisation software. It is the Virtual Box which has enabled me to install Linux on Windows.


            Download Virtual box:https://www.virtualbox.org/


Ubuntu is a Linux distribution which is a free and open source software.


            Download Ubuntu 16.10:https://www.ubuntu.com/download/desktop


I will endeavour to find any issues, document them; while providing feedback on how to resolve these issues. I will classified this task into 6 steps. 


STEP 1:Installing Git on Linux





1.Installing Git on Ubuntu




First of all, we need to update the system and then we are going to install git.


CODE:

  • sudo apt-get update

  • sudo apt-get install git-core





2.Moving Around on the command line




In this step, you will get familiar with command line.

  • pwd ( present working directory)
     
       
         pwd command tell us about the directory we are located.


  • ls ( List)
     
          
         ls command list the contents of the current directory.


  • cd (Change directory)


         cd command is used to navigate between directories and folders.





NOTE:
        
         
           To cancel an action we use control c.


3. Basic Configuration And Download Drupal Using Git






Basic configuration




The following code are a simple way to update git configuration file.




1.The code below is going to define heervesh as author name to be used for all commits by the current user.


   CODE:
             

               git config --global user.name heervesh






    2.The code below is going to define heerveshdrc1234@gmail.com as author email to be used for all commits by the current user.


       CODE:



             git config --global user.email heerveshdrc1234@gmail.com




        3.The code below is going to set the current setting of core.autocrlf to be true. 


           CODE:



                          git config --global core.autocrlf true






            Download Drupal Using Git



            1.The git clone http://git.drupal.org/project/drupal.git is going to clone  http://git.drupal.org/project/drupal.git onto local machine




            CODE:






                    git clone http://git.drupal.org/project/drupal.git


                2.Git checkout 8.2.x is going to check  the branch 8.2.x


                CODE:

                        git checkout 8.2.x


                    3.Git pull is going to fetch the specified remote’s copy of current branch and immediately merge it into the local copy.


                    CODE:


                            git pull





                      5.Download a Project Using Git


                        • First of all, we need to move to modules found in Drupal as shown in the previous screenshot. we are going to use cd modules but make sure that you are in Drupal root.



                        • Then, we should go  to the link below and find a project on Drupal. Then click version control situated just below admin toolbar.
                                  

                                  LINK:https://www.drupal.org/project/admin_toolbar/git-instructions




                        First of all, I will do


                                  git clone --branch 8.x-1.x https://git.drupal.org/project/admin_toolbar.git


                                  and then  cd  admin_toolbar  in your terminal.

                          • Once the clone is completed, do the following code:


                                     1.ls -a



                                2.git status



                                3.git branch -a



                                4.git log -3






                          STEP 3:Testing patch


                          1)Move into Drupal 8 sandbox which you have cloned using cd command.
                          Then, check on which branch you are located.


                              CODE:


                                   git branch
                                  

                              NOTE:


                              If you are not an asterisk next to 8.x, you need to check out 
                              8.x


                              CODE:


                                   git checkout 8.x




                          2)WE are going to do the steps for getting started in the issue queue.


                              Link:



                             1.Go to Drupal 8 sandbox issue queen and making the necessary changes.


                                Changes:
                             
                            • Under component: select Miscellaneous


                            • Under category:select Bug report

                                   Then insert the line below as tittle:


                                        Rewrite description for URL alias on node/add/*


                                  Then copy the text below, paste into the issue summary and save it as shown in the     
                                  screenshot below:



                              Note: This issue is being posted here as an exercise by a participant in the http://drupalladder.org ladder for contributing to core. Please don't do anything with this post. The real issue has already been resolved in Drupal 8. If you would like to try this exercise yourself, visit http://drupalladder.org and click on Drupal Ladder

                              Current:
                              Optionally specify an alternative URL by which this content can be accessed. For example, type "about" when writing an about page. Use a relative path and don't add a trailing slash or the URL alias won't work.

                              Proposed:
                              The alternative URL for this content. For example, type "about" when creating an about page. Use a relative path without a trailing slash


                                  




                              STEP 2:Install Drupal 8 sandbox for Drupal ladder.



                              CODE:


                              • git clone --branch 8.x https://git.drupal.org/sandbox/bhirsch/1388780.gitdrupal_8_sandbox_for_drupal_ladder

                              • cd drupal_8_sandbox_for_drupal_ladder





                              3)Download the patch and save it as .patch


                              diff --git a/core/modules/path/path.module b/core/modules/path/path.module
                              index 332287d..8ca61a5 100644
                              --- a/core/modules/path/path.module
                              +++ b/core/modules/path/path.module
                              @@ -136,7 +136,7 @@ function path_form_node_form_alter(&$form, $form_state) {
                                   '#maxlength' => 255,
                                   '#collapsible' => TRUE,
                                   '#collapsed' => TRUE,
                              -    '#description' => t('Optionally specify an alternative URL by which this content can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
                              +    '#description' => t('The alternative URL for this content. Use a relative path without a trailing slash. For example, enter "about" for the about page.'),
                                 );
                                 $form['path']['pid'] = array('#type' => 'value', '#value' => $path['pid']);
                                 $form['path']['source'] = array('#type' => 'value', '#value' => $path['source']);
                              @@ -303,4 +303,4 @@ function path_taxonomy_term_update($term) {
                               function path_taxonomy_term_delete($term) {
                                 // Delete all aliases associated with this term.
                                 path_delete(array('source' => 'taxonomy/term/' . $term->tid));
                              -}
                              +







                              No comments:

                              Post a Comment