Drupal 8 Module of the Week - Webform (formerly known as YAML Form)

jam
March 7, 2017
1
Drupal 8 logo

This week: The Webform Module // Drupal 8 has more and more features available practically every day. Alongside module migrations and new projects, the Drupal community’s latest major release also offers new ways of solving common problems. Some functionality has moved to Drupal core and new modules have taken up the torch along the way. In this series, the Acquia Developer Center is profiling useful solutions--modules, themes, distros, and more--available for Drupal 8.

Jacob Rockowitz (jrockowitz) has been building custom enterprise CMS solutions for the past 15 years and has been active in the Drupal community since 2009. I’ve been speaking with him about the YAML Form module–now moved to the Webform namespace–for a while; since before it had a UI. Now, the module he created combines its original developer friendly approach (build powerful forms quickly using YAML files) with a great end user and UI experience.

In a multi-billion dollar market for online form and survey builders, there aren’t a lot of open source solutions; the combination of Drupal 8 plus Webform is unmatched. And Jacob has a compelling vision for it:

“My primary goal for the Webform module is to build a powerful Open Source form builder that convinces more people to switch to Drupal. Similar to Acquia's Lightning distribution, I think the Webform module could become one of the deciding factors for companies considering switching to Drupal 8. It should help us all sell Drupal 8.” - Jacob Rockowitz

What does Webform do?

The Webform module is a form builder and submission manager for Drupal 8. That’s a big job needed for lots of projects. The module’s primary use case covers all of the following:

  • Build a new form or duplicate an existing template
  • Publish the form as a page, node, or block
  • Collect submissions
  • Send confirmations and notifications
  • Review submissions online
  • Download submissions as a CSV

Webform for Drupal 8 is running on almost 7,000 sites and growing fast as of early 2017. Webform for D7 is still reporting more than 450,000 installs. It will be interesting to see what happens to the Webform module's Drupal 8 usage statistics through the year.

Webform session at DrupalCon Baltimore!

Don’t miss the chance to learn more, directly from the source. Attend Jacob’s session Webform 8.x-5.x at DrupalCon Baltimore!

Webform session - DrupalCon Baltimore 2017

Why is Webform important?

“Developers and site-builders can build forms and surveys with it in Drupal, using the tools they are most comfortable with.The Webform module for Drupal 8 started out life as the YAML Form module, which was a developer-centric solution for building forms. Site builders construct robust and customizable forms in the UI; developers can build and edit forms directly in the YAML source code. There are no other form builders on the market that make it this easy for experienced developers to quickly edit and build forms.”

“For site owners and businesses,” explains Jake, “besides watching your developers be more productive and happier building forms … :-) … you will see better looking and fully integrated forms on your website, that are being built faster and cheaper. Everything and anything is possible when it comes to building rich forms that integrate with multiple systems and APIs. For example, you can build internal applications that fully integrate external CRMs into your website.”

“The Drupal community benefits from having this free and open source solution for building powerful forms in Drupal 8. The Webform module is a tool, and product, that can be used to inspire new developers and organizations to adopt Drupal. I hope the Webform module makes it easier for people in the Drupal community to do their jobs and accomplish their project goals. I think the Webform module could become one of the deciding factors for companies considering switching to Drupal 8. It should help us all sell Drupal 8.”

“The Webform module is a very important module to the Drupal community. I think the lack of an enterprise form builder for Drupal 8, did contribute to a slower initial adoption of Drupal 8. Hopefully in 2017, we will see more sites adopting Drupal 8.”

Webform module for Drupal 8 (video)

When was your module created?

“I was the lead developer responsible for migrating, architecting, and building Memorial Sloan Kettering’s current Drupal 8 website. MSK was one of the largest early adopters of Drupal 8, launching a 30,0000+ page website using a Beta release of Drupal 8. Webform was not available for Drupal 8; a form builder and submission manager was essential to the success of the project.”

“We had to come up with a quick and simple D8 replacement for the Webform module and I built YAML Form. The original concept was to provide the simplest UI possible that required the least amount of work for building forms. Building a user interface is a lot of work, while editing YAML files required very little work to set up. We chose a geeky technical route, serializing render arrays into editable YAML with some Form API documentation. This with a little training allowed MSK’s site builders to successfully build and manage hundreds of forms.”

“Since early 2016, I have been building out and improving this module iteratively, trying to reach feature parity with the D7 Webform module and other online form builders, such as Wufoo and Gravity Forms. Personally, I saw this project as professional challenge, resume builder, and an opportunity to give back to the Drupal community the best way I know how.”

Has Drupal 8 changed Webform?

“It is very important to emphasize that the Webform module for Drupal 8 is completely new code base and approach to building forms compared to Webform for D7. There are lots of new features and some D7 features are still missing for now.”

“Drupal 8 changed the way I write code and think about my applications. I had to change from being a functional programmer to Object Oriented developer. I adopted several best practices from Drupal 8 for the module, including OO design patterns, writing tests, continual refactoring, and an API-first approach.”

“This project was a ridiculous amount of work–15-20 hours a week for a year–but not that hard because the core API's (FAPI, Plugins, Config Entities, etc…) that the Webform module is extending are well documented and very stable. Importantly, the Drupal Association's improvements to Drupal.org's automated testing made it possible to implement a fully tested workflow using feature branches.”

“My approach was to set small reasonable goals that could be accomplished in 2-3 week ‘personal sprints’, while continually refactoring the code and learning from my mistakes.” At the same time Jacob had to make sure not let bugs and feature requests sit in the module's issue queue too long. He admits to having a ‘dirty trick’ to increase the quality of the module and his development velocity. “Occasionally, I have had to make 'bullish' commits of 'reasonably' working features, instead of waiting for the community to review the patch/change ... knowing the next beta release of the module would force everyone to do the needed review. Basically, I got people to help me with QA for me by releasing experimental code.” Whatever works, man! ;-)

Thank you, Jacob!

Jake is the sole sponsor of this project and does the work in his spare time. ***THANK YOU!*** I asked him how he supports all the time and effort he’s poured into Webform. “I wake up very early in the morning and occasionally stay up very late. I have also been very fortunate to have steady consulting work with Memorial Sloan Kettering. In 2017, I would like to start helping sites get the most out the Webform module. I want to start partnering and consulting with Drupal shops and organizations that have specific and custom Webform requirements that need to be addressed. I am also hope that third party SAAS providers will start sponsoring high quality and fully supported integrations between the Webform module these external applications.”

Building a module, building community

“Personally, I take a huge amount of pride when someone new to the Drupal community creates a D.O. account and posts their first D.O ticket in the Webform module's issue queue,” Jacob really opened my eyes here, “because my work has convinced someone to get involved in the Drupal community. I also enjoy being able to give this new member of Drupal community their first commit credit.”

How we got here - the bike shed delivers!

If you want to geek out on Drupal’s community in action, the discussion and decision to move the YAML Form module into the Webform's module namespace is a fascinating read. Check it out: Should the YAML form module change its name? “It really shows how a community of developers can come together and make a decision. Personally,” he explains, “I never thought I would become the maintainer of the Webform module and you can even see in some of my comments I was a little hesitant to take on this responsibility.” Thanks for taking it on, Jake.

Building Webforms in Drupal 8 (video)

Jacob’s Drupal Camp NJ 2017 session:

Sign-up for our Developer Blog Newsletter

Thanks!

Add comment

By submitting this form, you accept the Mollom privacy policy.