GSoC’17 Coding period | Week #5 | UC Wishlist



The second phase of the Coding Phase officially kicked off the previous week on June 30th, 16:00, marking the conclusion of the First Evaluation period for Google Summer of Code 2017. On the personal front, I would like to state that I progressed successfully through the evaluations by completing the two designated ports for my project ‘Porting UC Wish list to Drupal 8’, under the able guidance of my mentor, Naveen Valecha. I have also maintained a detailed info for the work done as part of the first phase evaluations in a previous blogpost.

As I had mentioned in the earlier week, the work for the second phase would involve porting the following sub-modules:

  • Allowing a user to view/update wishlist

  • Option to email wishlist to others

The previous week, based on the mentor’s review of the earlier ports done, I had also fixed the coding standards and made some changes to the code, as suggested by him. Meanwhile, based on a comprehensive analysis for the above mentioned ports, the work done briefly the earlier week can be stated as:

  • Viewing/Updating a wish list:

    • Learnt the implementation of the Form & Module APIs, while the forms are created using $form=\Drupal::formBuilder()->getForm( ). This had also been previously used while creating the administrator wish list settings.

    • Learnt the use of the Theme API which is used to arrange the created forms in the resulting page.

    • The callback: uc_wishlist_display($wid, $mode) is utilised under the function uc_wishlist_view_form to check for required permissions and private checkbox for lists:  

      • Set $wid (wish list id) if it is null.  

      • Check the if user is wishlist owner and provide right to edit.

      • If the user is not the owner and there are no products, then show the link to search.       

      • Display the required list if user is the owner or list is not private.

'View wishlist' option visuals in D8:



  • Emailing wish list to other users:

    • Learnt how to define the Email subject, Email recipients & Email message properties in an appropriate hook_mail implementation.

    • The application of the Database API to provide a structured interface for the dynamic construction of queries to implement the above functionality.

    • Learnt the use of the Renderable Array System to be applied to improve the grouping of form items. The email could then be sent by using Mail Manager using public function MailManager::mail.

Email wishlist option visuals:



As of now, I’ve completed a significant portion of porting the the first functionality, i.e., ‘Viewing/Updating user wish list’. However, I would have to integrate the ‘Update’ functionality to modify any specific wish list, so that on accessing the ‘Wish list’ link the user wish list is displayed with the added products along with the ‘Update’ option as mentioned above. Also, the complete code for the current status of the project can be found here.

Winding up, these were the objectives and concepts learned during the third week of coding phase in GSoC’17. Hope to learn many more new concepts in the coming weeks for the successful completion of the port.