Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 2 hours 58 min ago

Debug Academy: Advance Your Career With DebugAcademy at DrupalCon 2020

Mon, 02/24/2020 - 21:36
Advance Your Career With DebugAcademy at DrupalCon 2020


lindseygemmill Mon, 02/24/2020

Amazee Labs: Don’t Wait for Drupal 9 -- There’s Never Been a Better Time to Upgrade Your Site

Mon, 02/24/2020 - 21:02
This blog will outline the differences between the last migration and the upcoming shift to Drupal 9, what it means that Drupal 7 will be end-of-life by 2021, and why there has never been a better time to migrate to Drupal 8, which will make the transition even easier. 

Flocon de toile | Freelance Drupal: Starting a migration with Migrate programmatically

Mon, 02/24/2020 - 20:09
Migrate, a module integrated into the Drupal 8 Core, is a powerful solution for setting up data import processes from any data source (CSV, XML, Database, JSON, etc.) to a Drupal 8 project. The purpose of this post is not to explore all the facets of Migrate, as they are numerous and are already covered in many blog posts or official documentation, but rather to address a particular point: how to programmatically launch a migration?

InternetDevels: ID Drupal Contribution Day 22/02/2020: how it was

Mon, 02/24/2020 - 18:29

Every contribution makes Drupal shine brighter! The InternetDevels team knows it so we decided to hold ID Drupal Contribution Day on Saturday, 22. We gathered to improve a bunch of modules and make them ready for a smooth Drupal 9 upgrade. Let’s see how it was.

Read more

Bloomidea's Blog: How to Custom Sort your Drupal Commerce Store

Mon, 02/24/2020 - 17:06

Views and Facets modules give you some advanced sorting options for your catalogue of products when building your ecommerce store. But sometimes all those algorithmic options are not what the client wants, they want to custom sort their merchandizing in the way that best promotes their products.

Tags: drupal

Digital Echidna: Thoughts on all things digital: Smart Date 2.0: Let's Do This Again!

Mon, 02/24/2020 - 12:02
The first stable release of Smart Date delivered on my original vision for the module, namely, the need for a more app-like editor experience and intelligent formatting of dates and times in Drupal. And, thanks to feature requests and input from…

Third & Grove: A Sure-Fire Migration Approach to Drupal 8

Mon, 02/24/2020 - 03:27

The key to a successful integration to Drupal 8 is a solid understanding of your Drupal 7 site, so you know what to migrate over and what to avoid. Here’s what you need to know.

GuillaumeDuveau: A security experiment with Fail2Ban, Syslog and Honeypot

Sun, 02/23/2020 - 15:27

Every site has a lot of weekly / daily attempts to abuse your forms to submit their bad content, create users, login... Here we will try to ban some of those IPs directly in the server firewall, so they can't even reach Drupal.

At first, this method might not be applicable for you. If you have a professional hosting / PaaS, your provider could (should ?) already take care of this. At least globally, maybe not specifically for Drupal attacks. For this method, you must have be able to log on your server with a user that has admin rights. This post is especially written for Debian Buster, but it should be more or less the same for other Debian versions. For other distributions, you might have to tweak some things.

Then, as you will see in the conclusion, I tend to think that this method is not sustainable in the long term. This really has to be taken as an experiment. Creating a Behat step definition with arguments over multiple lines

Fri, 02/21/2020 - 23:39

Here is a quick tip if you want to create a step definition that has an argument with multiple lines. A multiline string argument if you like.

I wanted to test that an email was sent, with a specific subject, to a specific person, and containing a specific body text.

My idea was to create a step definition that looked something like this:

Then an email has been sent to "" with the subject "Subject example" and the body “one of the lines in the body plus this is the other line of the body, after an additional line break”

So basically my full file is now this:

@api @test-feature Feature: Test this feature Scenario: I can use this definition Then an email has been sent to "" with the subject "Subject example" and the body “one of the lines in the body plus this is the other line of the body, after an additional line break”

My step definition looks like this:

/** * @Then /^an email has been sent to :email with the subject :subject and the body :body$/ */ public function anEmailHasBeenSentToWithTheSubjectAndTheBody($email, $subject, $body) { throw new PendingException(); }

Let’s try to run that.

$ ./vendor/bin/behat --tags=test-feature In Parser.php line 393: Expected Step, but got text: " plus this is the other line of the body, after an additional line break”" in file: tests/features/test.feature

Doing it that way simply does not work. You see, by default a line break in the Gherkin DSL has an actual meaning, so you can not do a line break in your argument, expecting it to just pass along everything up until the closing quote. What we actually want is to use a PyString. But how do we use them, and how do we define a step to receive them? Let’s start by converting our step definition to use the PyString multiline syntax:

@api @test-feature Feature: Test this feature Scenario: I can use this definition Then an email has been sent to "" with the subject "Subject example" and the body """ one of the lines in the body plus this is the other line of the body, after an additional line break """

Now let’s try to run it:

$ ./vendor/bin/behat --tags=test-feature @api @test-feature Feature: Test this feature Scenario: I can use this definition # tests/features/test.feature:3 Then an email has been sent to "" with the subject "Subject example" and the body """ one of the lines in the body plus this is the other line of the body, after an additional line break """ 1 scenario (1 undefined) 1 step (1 undefined) 0m0.45s (32.44Mb) >> default suite has undefined steps. Please choose the context to generate snippets:

A bit closer. Our output actually tells us that we have a missing step definition, and suggests how to define it. That’s better. Let’s try the suggestion from the output, now defining our step like this:

/** * @Then an email has been sent to :email with the subject :subject and the body */ public function anEmailHasBeenSentToWithTheSubjectAndTheBody2($email, $subject, PyStringNode $string) { throw new PendingException(); }

The difference here is that we do not add the variable name for the body in the annotation, and we specify that we want a PyStringNode type parameter last. This way behat will know (tm).

After running the behat command again, we can finally use the step definition. Let's have a look at how we can use the PyString class.

/** * @Then an email has been sent to :email with the subject :subject and the body */ public function anEmailHasBeenSentToWithTheSubjectAndTheBody2($email, $subject, PyStringNode $string) { // This is just an example. $mails = $this->getEmailsSomehow(); // This is now the important part, you get the raw string from the PyStringNode class. $body_string = $string->getRaw(); foreach ($mails as $item) { // Still just an example, but you probably get the point? if ($item['to'] == $mail && $item['subject'] == $subject && strpos($item['body'], $body_string) !== FALSE) { return; } } throw new \Exception('The mail was not found'); }

And that about wraps it up. Writing tests are fun, right? As a bonus, here is an animated gif called "Testing".

Hook 42: Hook 42 is Headed to Minneapolis for DrupalCon 2020

Fri, 02/21/2020 - 22:51
Hook 42 is Headed to Minneapolis for DrupalCon 2020 Lindsey Gemmill Fri, 02/21/2020 - 20:51

DrupalCon News: Announcing the Sessions for DrupalCon Minneapolis

Fri, 02/21/2020 - 19:34

The accepted sessions for the next DrupalCon are now posted—and what an impressive lineup!

Curated content for the 45-minute sessions is packed with compelling insight, information, and your chance to learn the latest in Drupal. As you look at a session online (such as the one shown below), note its right-hand box with its designated track, tags that further explain its content, the experience level it’s geared toward, and a special button to add it to your DrupalCon schedule! - Thoughts: Can Drupal be used for mobile apps?

Fri, 02/21/2020 - 10:00
Any website being developed these days is built on top of a responsive framework allowing pages to adapt and re-layout content based on the size of the viewing device.  Perfect for mobile and tablet devices alongside traditional desktop screens.  So why are mobile apps still chased after by people? What’s wrong with their responsive website?

Amazee Labs: Our Next Webinar: Advanced BDD with Cypress

Thu, 02/20/2020 - 18:58
Join us on March 19th for an Amazee Labs Webinar about Advanced BDD with Cypress. 

DrupalEasy: DrupalEasy Podcast 224 - Jacob Rockowitz, Ted Bowman

Thu, 02/20/2020 - 16:23

Direct .mp3 file download.

We talk with Jacob Rockowiz about the Webform variants and A/B testing and Ted Bowman about Drupal 9 info.yml files.

URLs mentioned DrupalEasy News Sponsors Subscribe

Subscribe to our podcast on iTunes, Google Play or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

The Savvy Few: How to customize the language switcher in Drupal 8

Thu, 02/20/2020 - 16:18

As a creative digital agency based in Amsterdam, we’ve gotten used to having two languages of conduct: Dutch and English. We switch back and forth without even noticing and have learned to read, write and conduct business in both languages effortlessly. Our clients are…

Read more

CTI Digital: CTI goes to Drupal Camp London 2020

Thu, 02/20/2020 - 15:54

Drupal Camp London is a 3-day celebration of the users, designers, developers and advocates of Drupal and its community! Attracting 500 people from across Europe, after Drupalcon, it’s one of the biggest events in the Drupal Calendar. As such, we're pleased to sponsor such an event for the 6th time!

Droptica: Drupal Agency Experts Heading To DrupalCamp London 2020

Thu, 02/20/2020 - 11:24
DrupalCamp London is a great event for all Drupal agencies. It is a conference that brings together hundreds of Drupal experts from around the world. It's a great opportunity to meet people who use, develop, design and support the Drupal platform. Therefore, as usually we will be there this year as well. Droptica is a sponsor of DrupalCamp London 2020 We are proud to sponsor and participate in this year's DrupalCamp London. The event will take place on March 13-15, 2020 in London. Form Modes & Wizard Tutorial for Drupal 8

Thu, 02/20/2020 - 02:00

My appreciation for form API in Drupal is on the same level as my attempt to avoid it when it comes to user facing forms. Both are pretty high. The reasons I love it are because it’s extendible and security is built in. I’ve worked with a few other frameworks in different languages, and my impression is that Drupal’s form API is significantly more advanced than any other solution I’ve seen.

The reason I try to avoid it, on the other hand, is mainly because it’s hard to create forms that satisfy the end users, and achieve their expectations. Basically, forms are bulky, and going with a mix of JS/Ajaxy solutions is often a pain. Having a JS form (i.e. some JS widget that builds and controls the entire form), that POSTs to a RESTful endpoint takes more code, but often times provides a more streamlined user experience.

Not sure why and how, but over the years we’ve been tasked quite a few times with creating form wizards. It’s frequently used for more complex registrations, like for students, or alumnus applying for different programs. In the early Drupal 7 days we went with CTools’ wizard, and then switched to Elm (i.e. a JS form) along with RESTful endpoints. Drupal 8 however has one major feature that makes it very appealing to work once more with form API - that is “Form modes.”

This post has an example repo, that you should be able to reliably download and run locally thanks to DDEV. I will not try to cover every single line of code - but rather share the concepts behind our implementation, with some references to the code. The audience is intermediate-level Drupal developers, that can expect to have a good sense of how to use Form modes to build wizards after reading this post and going over the code.

Before diving in, it’s important to recognize that “wizards” come in many flavors. I personally hold the opinion that a generic module cannot be (easily) built to accommodate all cases. Instead, I look at Drupal 8 with its core and a couple of contrib modules as the “generic” solution to build complex - sprinkled with lots of custom business logic - wizards.

Nonprofit Drupal posts: February Drupal for Nonprofits Chat -- Pantheon, NTC Planning

Wed, 02/19/2020 - 23:24

Our normally scheduled call to chat about all things Drupal and nonprofits will happen TOMORROW, Thursday, February 20, at 1pm ET / 10am PT. (Convert to your local time zone.)

This month, in addition to our usual free-for-all, we'll be talking about hosting on Pantheon. There has been a lot of discussion in the community and on the Drupal Slack #nonprofits channel about some of the pricing changes they have implemented. If you would like to discuss and contribute to the conversation, please join us.

We will also have an update on our community's plans for the upcoming Nonprofit Technology Conference (20NTC).

All nonprofit Drupal devs and users, regardless of experience level, are always welcome on this call.

Feel free to share your thoughts and discussion points ahead of time in our collaborative Google doc:

This free call is sponsored by but open to everyone.

REMINDER: New call-in information -- we're on Zoom now!

  • Join the call:
    • Meeting ID: 308 614 035
    • One tap mobile
      • +16699006833,,308614035# US (San Jose)
      • +16465588656,,308614035# US (New York)
    • Dial by your location
      • +1 669 900 6833 US (San Jose)
      • +1 646 558 8656 US (New York)
  • Follow along on Google Docs:
  • Follow along on Twitter: #npdrupal

View notes of previous months' calls.

Lullabot: Drupal 9 Olivero: Turning Conversation into a Core Initiative

Wed, 02/19/2020 - 20:11

One of the biggest benefits of an open-source community like Drupal is the ability to collaborate with fantastic people that you wouldn’t otherwise have the opportunity to work with. However, when you have an idea that you think would be a good initiative for a Drupal core release (such as Drupal 9) you might find yourself thinking: "How do I even begin? How can I advocate for my idea?” We all find ourselves asking these questions as we navigate the complex journey of turning an idea into a core initiative.