Drupal

Drush CMI Tools

New Drupal Modules - 6 February 2019 - 7:25pm

Provides advanced CMI import and export functionality for CMI workflows.

Categories: Drupal

Dries Buytaert: Drupal helps rescue ultra marathon runner

Planet Drupal - 6 February 2019 - 5:34pm

I'm frequently sent examples of how Drupal has changed the lives of developers, business owners and end users. Recently, I received a very different story of how Drupal had helped in a rescue operation that saved a man's life.

The Snowdonia Ultra Marathon website

In early 2018, Race Director Mike Jones was looking to build a new website for the Ultra-Trail Snowdonia ultra marathon. He reached out to a good friend and developer, Rob Edwards, to lead the development of the website.

© Ultra-trail Snowdonia and No Limits Photography

Rob chose Drupal for its flexibility and extensibility. As an organization supported heavily by volunteers, open source also fit the Snowdonia team's belief in community.

The resulting website, https://apexrunning.co/, included a custom-built timing module. This module allowed volunteers to register each runner and their time at every aid stop.

A runner goes missing

Rob attended the first day of Ultra-Trail Snowdonia to ensure the website ran smoothly. He also monitored the runners at the end of the race to certify they were all accounted for.

Monitoring the system into the early hours of the morning, Rob noticed one runner, after successfully completing checkpoints one and two, hadn't passed through the third checkpoint.

© Ultra-trail Snowdonia and No Limits Photography

Each runner carried a mobile phone with them for emergencies. Mike attempted to make contact with the runner via phone to ensure he was safe. However, this specific area was known for its poor signal and the connection was too weak to get through.

After some more time eagerly watching the live updates, it was clear the runner hadn't reached checkpoint four and more likely hadn't ever made it past checkpoint three. The Ogwen Mountain Rescue were called to action.

Due to the terrain and temperature, searching for the lost runner on foot would be too slow. Instead, the mountain rescue volunteers used a helicopter to scan the area and locate the runner.

How Drupal came to rescue

The area covered by runners in an ultra marathon like this one is vast. The custom-built timing module helped rescuers narrow down the search area; they knew the runner passed the second checkpoint but never made it to the third.

After following the fluorescent orange markers in the area pinpointed by the Drupal website, the team quickly found the individual. He had fallen and become too injured to carry on. A mild case of hypothermia had set in. The runner was airlifted to the hospital for appropriate care. The good news: the runner survived.

Without Drupal, it might have taken much longer to notify anyone that a runner had gone missing, and there would have been no way to tell when he had dropped off.

NFC and GPS devices are now being explored for these ultra marathon runners to carry with them to provide location data as an extra safety precaution. The Drupal system will be used alongside these devices for more accurate time readings, and Rob is looking into an API to pull this additional data into the Drupal website.

Stories about Drupal having an impact on organizations and individuals, or even helping out in emergencies, drive my sense of purpose. Feel free to keep sending them my way!

Special thanks to Rob Edwards, Poppy Heap (CTI Digital) and Paul Johnson (CTI Digital) for their help with this blog post.

Categories: Drupal

Lullabot: Why Programmers Should Read Good Fiction

Planet Drupal - 6 February 2019 - 1:17pm

If you are a programmer looking to improve your professional craft, there are many resources toward which you will be tempted to turn. Books and classes on programming languages, design patterns, performance, testing, and algorithms are some obvious places to look. Many are worth your time and investment.

Categories: Drupal

Webform Product

New Drupal Modules - 6 February 2019 - 12:03pm

Webform Product can create a Commerce order from any Webform submission.

This module can be used for websites that have commerce for payment of predefined product types, but in need of a more flexible product for temporary product types or highly customisable product types, like a quick donation form or a promotional product.

With Webform you can create simple or very complex forms, combine this with the easy to setup handler and you got a new product, ready to be paid with any payment provider defined in Drupal Commerce.

Categories: Drupal

Entity Registration Form

New Drupal Modules - 6 February 2019 - 9:34am
Categories: Drupal

Agaric Collective: Pass variables without escaping nor sanitizing to t() in Drupal 8

Planet Drupal - 6 February 2019 - 9:12am

In Drupal 7 it was useful to do things like this: 

function mymodule_content() { $links[] = l('Google', 'http://www.google.com'); $links[] = l('Yahoo', 'http://www.yahoo.com'); return t('Links: !types', array('!types' => implode(', ', $links))); }

In this case, we are using the exclamation mark to pass the $links into our string but unfortunately, Drupal 8 doesn't have this option in the FormattableMarkup::placeholderFormat(), the good news is that even without this there is a way to accomplish the same thing. 

Read more and discuss at agaric.coop.

Categories: Drupal

Paragraphs View Mode Field

New Drupal Modules - 6 February 2019 - 7:33am
Categories: Drupal

TMGMT GearTranslations

New Drupal Modules - 6 February 2019 - 6:54am

Under Development.

Categories: Drupal

Mass.gov Digital Services: Introducing Drupal Test Traits

Planet Drupal - 6 February 2019 - 6:34am
Mass.gov dev team releases open source project

The Mass.gov development team is proud to release a new open source project, Drupal Test Traits (DTT). DTT enables you to run PHPUnit tests against your Drupal web site, without wiping your database after each test class. That is, you test with your usual content-filled database, not an empty one. We hope lots of Drupal sites will use DTT and contribute back their improvements. Thanks to PreviousNext and Phase2 for being early adopters.

Mass.gov is a large, content-centric site. Most of our tests click around and assert that content is laid out properly, the corresponding icons are showing, etc. In order to best verify this, we need the Mass.gov database; testing on an empty site won’t suffice. The traditional tool for testing a site using an existing database is Behat. So we used Behat for over a year and found it getting more and more awkward. Behat is great for facilitating conversations between business managers and developers. Those are useful conversations, but many organizations are like ours — we don’t write product specs in Gherkin. In fact, we don’t do anything in Gherkin beside Behat.

Meanwhile, the test framework inside Drupal core improved a lot in the last couple of years (mea culpa). Before Drupal Test Traits, this framework was impossible to use without wiping the site’s database after each test. DTT lets you keep your database and still test using the features of Drupal’s BrowserTestBase and friends. See DrupalTrait::setUp() for details (the bootstrap is inspired by Drush, a different open source project that I maintain).

Zakim Bridge at Night, North End Boston. Photo by David Fox.Using DTT in a Testhttps://medium.com/media/cbe46617878edbc55bbf67c573fbc46a/href
  • Our test cases extend ExistingSiteBase, a convenience class from DTT that imports all the test traits. We will eventually create our own base class and import the traits there.
  • Notice calls to $this->createNode(). This convenience method wraps Drupal’s method of the same name. DTT deletes each created node during tearDown().
  • Note how we call Vocabulary::load(). This is an important point — the full Drupal and Mink APIs are available during a test. The abstraction of Behat is happily removed. Writing test classes more resembles writing module code.
More Featureshttps://medium.com/media/7c921cc06be32c3b0944aef1d597e853/hrefMisc
  • See the DTT repo for details on how to install and run tests
  • Typically, one does not run tests against a live web site. Tests can fail and leave sites in a “dirty” state so it’s helpful to occasionally refresh to a pristine database.

If you have questions or comments about DTT, please comment below or submit issues/PRs in our repository.

More from Moshe: Our modern development environment at Mass.gov

Interested in a career in civic tech? Find job openings at Digital Services.
Follow us on Twitter | Collaborate with us on GitHub | Visit our site

Introducing Drupal Test Traits was originally published in MA Digital Services on Medium, where people are continuing the conversation by highlighting and responding to this story.

Categories: Drupal

Simply Signups

New Drupal Modules - 6 February 2019 - 5:58am

The Simply Signups module allows users to set up a simple event rsvp/signup system. Every event can have its own unique rsvp form. There is also templating available. You can set up a form template that can be loaded and adjusted on a per node/event basis.

Categories: Drupal

DrupalCon News: How to become a DrupalCon Mentor

Planet Drupal - 6 February 2019 - 4:35am

The backbone of every DrupalCon is the community of people who come together at the event, and in particular the involvement of community volunteers who collectively influence and shape the experiences of others in attendance. In short, Mentors!  

 

Categories: Drupal

OPTASY: How to Send Richly Formatted HTML Emails in Drupal 8: Deliver the Experiences that Your Customers Expect in 2019

Planet Drupal - 6 February 2019 - 4:07am
How to Send Richly Formatted HTML Emails in Drupal 8: Deliver the Experiences that Your Customers Expect in 2019 adriana.cacoveanu Wed, 02/06/2019 - 12:07

API first, responsive Bartik, headless and decoupled Drupal, Layout Builder, React admin UI... Drupal's evolved tremendously over these 18 years! Yet: the emails that we send out via its otherwise robust email sending system aren't different from those we used to send a... decade ago. And customers expect rich experiences outside your Drupal website or app. While website administrators expect to be enabled to easily manage, via the admin UI, their email content templates. So: how do you send HTML emails in Drupal 8?

Without relying on external services, of course...

And who could blame customers for expecting 2019-specific user experiences? Experiences that HTML-enabled emails deliver through their great features.

Categories: Drupal

Third & Grove: The 15 Things Your AEM Team Says Drupal Can't Do, But Can

Planet Drupal - 6 February 2019 - 4:00am
The 15 Things Your AEM Team Says Drupal Can't Do, But Can justin Wed, 02/06/2019 - 07:00
Categories: Drupal

ThinkShout: Fear and Loathing in Support Development

Planet Drupal - 6 February 2019 - 4:00am

Consider the following exchange:

Project Manager: “Hey Joe, next week we’d like you to add some new features to [client site].”

Me: “Sure thing! Where is it hosted?”

PM: “Ah, well… we’re not really sure. We’ve asked the client. The thing is, they haven’t been able to do any work on the site for the last couple of years, because someone built the site for them and then launched it without documentation, and with no support.”

Me: *Stunned Look*

PM: “Also, they don’t use any version control. So updates will have to be done via FTP.”

Me, reeling: “I… I don’t even think I have an FTP client on my computer.”

PM: “We believe in you.”

This is a worst-case support development scenario, one likely to bring with it uncertainty and fear. However, with a methodical approach, even the worst case can be turned to your advantage.

Getting started: Docs and detective work.

The very first thing to do when you have a new support project is to find the site documentation, or failing that, create a place for new docs. You are in the best position to document the site, because you don’t have any preconceived ideas about what to do - so document everything. Future engineers (and future you) will thank you.

Starting with the site and its hosting, you can reverse-engineer pretty much anything. You can even reverse-engineer the hosting if you need to, using Robtex! (Find the host, and ask the client to reach out to them for login info).

Once you have the hosting info, you can log in and establish the following: Are they running backups? Do they use a database, and is it backed up? Do they have any version control? Is there any sort of deployment process? Do they have a staging environment?

If the answer is ‘No’ to any of the above, then it’s usually pretty easy to add/enable. Once you have a ‘Yes’ for all of the above, update the documentation, password manager, etc. For example, even if they don’t use version control, there’s nothing stopping you from adding it to your local install, and pushing that code to a (now free!) private GitHub repo.

From there, you can add user accounts for yourself, and if it’s a CMS-based website such as WordPress or Drupal, log in and start investigating the code.

Figuring out the code - locally.

It’s always a good idea to do code investigations on a local installation - any tweaks and debug code can be spotted pre-deploy and removed. Make sure you document the process of getting a local installation up and running as well! Example: letting your co-workers know that they should run the WordPress-based wp-cli command wp search-replace client-site.com client-site.localhost on a newly imported database will save them hours of frustration, as well as preventing terrible accidents from happening (WordPress will quietly redirect you to the live site after logging in if you don’t change the site URLs in the local database. Oopsie!)

Once set up locally, you can start looking for theme-layer build tips. In the root of the project, look for Composer files, (which could indicate an automated build process). A README would also be a good thing to look for - these will often be the hidden documentation for a project.

You should also look for any taskrunner files, such as those used by Gulp or Grunt, or any other files that you wouldn’t expect to see in a clean install of the CMS.

Next, find the active theme. Usually, you can inspect the website and find paths to the theme from images (WordPress), or the favicon link in the header (Drupal).

Once you’ve located (and documented) the theme location, look in the theme for taskrunners, as well as any README files. If there’s are none to be found, look for a Sass or {less} directory. Gemfiles and Rakefiles will also give hints about the type front-end preprocessors in use, and what the scope of the preprocessor is. If it’s an older site, it might still use a Compass-based framework. If there’s no preprocessor, it might be using vanilla CSS!

Once all of that is done (and documented), you can actually start finding and working on code!

Where code?

Actually finding code can be tricky - say it’s a WordPress site, and you’ve been asked to add a menu to ‘campaign’ pages across the site. How to find the template quickly?

This is where a codebase searchable IDE is handy. Sites can have tens of thousands of files, and you want to be able to narrow your search. In the case of a WordPress template, you’d limit the search to the theme directory, preferably with a *.php file extension. From there, you can look at a campaign page and look for specific classes. In our case, hero-area campaign.

Result:

Don’t be a hero - use smart search

This site had over 100,000 files! A full search could have taken several minutes instead of the 1-2 seconds it took to search the 244 PHP files in the theme.

From here, you could simply get to work and add the menu, but it can be valuable to run a codesniffer against the template. The more it deviates from the coding standard for a particular CMS, the more likely your ‘correct’ code will run into issues. In addition, if the site is ever migrated to an automated deployment environment, it will fail builds that have coding standard filters.

You can also glean a lot about the mindset of the people who built the site - were they careful and clean in their coding style? Did they document/comment code? Did they make the same style errors over and over (like a lone developer would do) or is it random (like a team)?

You can also occasionally make fun discoveries:

Me: “OK, I installed the site locally and added the menu to the campaign template. I also noticed a coding error in the ‘related content’ section that was causing it to not display.”

PM: “Really? Do they have that on other content on the site?”

Me: “Yeah, every other content type has it. I suspect it was just an error that snuck in when someone was doing a search-and-replace on the code.”

PM: “So… how many pages did that impact?”

Me: “About 500 or so. It’s been that way for at least the last three years too.”

PM: *Stunned Look*

Categories: Drupal

Field Formatter Key Label

New Drupal Modules - 6 February 2019 - 3:38am
Categories: Drupal

VK Database Location Autocomplete

New Drupal Modules - 6 February 2019 - 3:19am
Categories: Drupal

Article test

New Drupal Modules - 6 February 2019 - 2:58am
Categories: Drupal

Appnovation Technologies: Simple Website Approach Using a Headless CMS: Part 1

Planet Drupal - 6 February 2019 - 12:00am
Simple Website Approach Using a Headless CMS: Part 1 I strongly believe that the path for innovation requires a mix of experimentation, sweat, and failure. Without experimenting with new solutions, new technologies, new tools, we are limiting our ability to improve, arresting our potential to be better, to be faster, and sadly ensuring that we stay rooted in systems, processes and...
Categories: Drupal

Brands

New Drupal Modules - 5 February 2019 - 11:06pm

Provides a taxonomy vocabulary that includes product brands.

Features:

This module simply provides a vocabulary named brands.

Categories: Drupal

Pages

Subscribe to As If Productions aggregator - Drupal