Drupal News

MidCamp - Midwest Drupal Camp: Join us to help plan MidCamp 2021

Main Drupal Feed - Fri, 09/11/2020 - 15:46
Join us to help plan MidCamp 2021

Please join us for our first MidCamp 2021 planning meeting!

Why come?

Because we value giving back to the Drupal community and this is one way you can do that.

What should I expect?

That's mostly up to you -- there are a lot of roles and skillsets needed to put on a conference like MidCamp. Regardless of what you do day-to-day, you can find a fit.

What if I don't live in Chicago?

That's OK! The planning of things is done remotely. A good portion of the planning team doesn't live in or near Chicago. People join because they care about Drupal and want to help make MidCamp happen.

How to join?

We'll be using a Waiting Room for the Zoom, so please RSVP if you plan on joining so we're able to let you in.

drunomics: Custom Elements: A solution for soft-decoupled Drupal!

Main Drupal Feed - Thu, 09/10/2020 - 12:49
Let's decouple Drupal - Well, what exactly?

When it comes to decoupling, it turns out there are many options on how to decouple. Not only are there many technology choices in choosing the right frontend framework and APIs involved, the questions become also more foundational: Which system should be in charge of handling different aspects of the application, e.g. routing, placing blocks or authentication?

So before moving on, we need to clarify what exactly we want to achieve:

Clarifying goals: Why to decouple?

For us, the main reasons are:

Independent frontend development

By separating the frontend from the backend, frontend development can happen completely independent of the backend. So frontend developers do not have to know Drupal development, but can focus solely or their part: the frontend. That way, it's much easier to find and onboard frontend developers.

Easier performance optimization

While efficiently lazy-loading CSS or JS assets of a page is quite hard to do with Drupal, modern frontend technologies handle this with breeze and simply lazy-load pre-built asset chunks as needed. Furthermore, the frontend can better optimize the page loading experience (and the assets needed per-page) since the frontend has the knowledge of what exactly is needed by which frontend component.

Re-usable frontend components

Re-usable frontend components - including asset dependency management - are a solved problem in the Javascript world and all the various Javascript frontend frameworks provide that. Additionally, tools like Storybook make it really easy to build up your own component library.

Modern frontend and UX

By building upon modern frontend tooling we can provide a more app-like UX to our users, handle client-side route changes and only reload and repaint what's needed when navigating pages. The web page can become and feel more app-like, or even be turned into a Progressive Web App that does more than providing an offline copy of the site!

Challenges faced

This sounds all good - but there are lots of challenges that must be well-considered:

Re-inventing the wheel

By throwing away Drupal's frontend, you also throw away all the existing integration Drupal provides with its own frontend. Besides the more obvious, like handling forms and logins, features like contextual edit links, previews or the layout builder just do not work out of the box anymore. So one has to develop alternative solutions for all those features - if needed. Depending on the solutions choosen, this can be a lot of work.

Server-Side-Rendering and Hosting

For delivering a decent user experience and being friendly to robots (Google) some sort of pre-rendering is needed on the server. So this needs extra thought and comes with new infrastructure requirements (Node.js) that, come at a cost, and must be considered when choosing where to host.

Cold cache performance

When the Drupal backend is connected via JSON API or GraphQL a first, uncached page load typically needs various kind of data, quickly ending up in multiple API requests to the backend. Since all of those need to be resolved on a cold-cache page hit requests possibly end up really slow and lead to slow first page loads.

Coupling of the frontend to the backend

When the frontend talks to Drupal via its default JSON or GraphQL APIs, the frontend needs to know about Drupal's data structure. Field names, their types and entity relationships are no Drupal interna anymore, but become part of the contract between the backend and the frontend, limiting the possibilities to develop them separately. One could implement custom JSON endpoints or GraphQL Schema to mitigate and fine-tune that.

Our solution: Rendering into Custom Elements markup

We figured that in order to reach the mentioned goals, we can use a soft approach to decoupled Drupal in order to keep more of Drupal's features available. The basic idea is that Drupal keeps rendering pages by providing the main page content as custom elements (markup). Then, this simplified markup can be picked up by client-side frameworks like Vue.js to handle rendering the elements client-side.

An example of custom element would be the following markup for a Twitter paragraph:

<pg-twitter src="https://twitter.com/bmann/status/1283090375742091264"> <h3 slot="title">#Driesnote suggesting to ship an official component for React and Vue for managing menus</h3> </pg-twitter>

Note that we use pg as abbreviation for paragraph here. Or a quote paragraph:

<pg-quote> <h1 slot="title">a quote from twitter...</h1> <p>#Driesnote suggesting to ship an official component for React and Vue for managing menus<br>Ship it in NPM as those devs expect.</p> <span slot="author">Boris Mann</span> </pg-quote>

Generating this markup, is exactly what the Custom Elements module does. The module renders the data of all visible fields either as attribute to the custom element tag, or as nested tag with a slot attribute.

As custom elements are part of Web components specification, web components provide a good fit for rendering the content client-side, but other client-side frameworks like Vue.js or React.js can pick up the data and render it as well - so there is plenty of choice for the best-suiting client-side solution.

So what about the page template?

Since the header and footer area is pretty static for most of the time on most of our sites, we figured they are best implemented by mostly static components in the frontend. Any dynamic parts, like meta tags or navigation elements can be complemented with data provided by (long-cached) API calls or even computed client-side (for example, the active menu item). If necessary, it's easy to re-render parts of it and client-side frameworks like Vue.js and React can handle updating only the necessary bits when navigating pages.
While the dynamic per-page content is provided by the backend in a single API response per page, the header and footer can be controlled by the frontend. The frontend application takes the custom element content and renders it, next to taking care of updating essential page metadata like meta tags.

 

Thus, for rendering individual pages, the frontend needs to fetch the main content - rendered as Custom Elements - as well as any page metadata that it needs for rendering the page from the backend. For that, we've implemented the Lupus Custom Elements Renderer module which turns Drupal into an API backend providing exactly that.

Summing up

By rendering the page shell and custom element content in a frontend framework of our choice, we achieve all of our goals stated. Moreover, the custom elements "format" provides a good way of decoupling the frontend of the backend, since any Drupalisms or backend complexities in the data model can easily by translated into a meaningful collection of custom elements. Those elements comprise a well-defined structure representing your site's content elements and transferring the necessary data to the frontend. In the frontend, the custom elements map nicely to Vue/React/Web/... components.

By keeping Drupal's page routing mechanism, we can keep using Drupal's path handling, including useful features like editor controlled path aliases or redirects. Since page responses are handled as whole by Drupal, we optimize and cache full-page responses and leverage Drupal's existing cache infrastructure and optimized cache tags for caching individual parts of the page.

Finally, the approach taken allows us to keep using some of Drupal's existing solutions like, cookie-based authentication for user-specific page responses, the layout builder or even form processing.

Following up

Since there is so many details more to talk about, I'll be following up with further blog posts in the coming weeks, covering the following topics:

  • Selecting a frontend framework. Server-Side-Rendering and hosting options
  • Architecture variants, Authentication, Custom Elements markup & json formats
  • A developer introduction: Creating components, adding Custom Element processors, the relationship to Drupal's render API, Custom routes and optimizing cache metadata.
  • Handling blocks & layout builder, content previews, forms, caching & performance optimizations.

Finally, I'm going to talk more about this stack at the Drupalcon Europe 2020 in my session "Custom Elements: An alternate Render API for decoupled Drupal" - so mark your calendars!

OpenSense Labs: First key Drupal modules to install right away

Main Drupal Feed - Thu, 09/10/2020 - 12:45
First key Drupal modules to install right away Shalini Rawat Thu, 09/10/2020 - 18:15

“Since getting started with Drupal can be a bit intimidating for newbies, this blog is literally a great investment to take a look at”.

Apparently, Drupal offers a wide range of modules, nearly thousands of modules that are available to download anytime and anywhere. Modules play a pivotal role in the overall Drupal experience. The reason being, a module is a compact set of PHP, JavaScript and/or CSS files that provide a framework to strengthen the functionality of the website.

When you are starting a new Drupal project, there are certain modules that you need to consider installing right away irrespective of what sort of industry type that is for or what will be the key functions of that website.

Therefore, in this blog, we have rounded up some of the most common Drupal modules that are really helpful and can be used in almost all cases. So, without any further ado, let’s get right into the article. 

Modules for site-building Admin Toolbar

The Drupal Admin Toolbar is a very light module and allows faster and easier functioning to all administration pages. The module is highly capable to improve the default Toolbar (the administration menu at the top of your site) by transforming it into a drop-down menu. You can also create simple icons using Admin Toolbar which offers quick shortcut links to make for a more mobile-friendly and receptive experience.

PathAuto

The PathAuto module is a must-have module in every Drupal project. It is one of those tools that has got your back when you experience some not-so-fun work. Not only this, but the module also does it quickly and effectively. The Drupal PathAuto module helps in generating SEO friendly and well-structured URLs. Site admins can also change the pattern system by changing the tokens it uses. Read the ultimate Drupal SEO guide for 2020 to know more about Drupal’s SEO features.

Token

A Token is a fundamental element in any Drupal website. This Drupal module provides additional tokens (which are not supported by core), as well as a UI for browsing tokens. In addition to this, the Token module auto generates metadata about a website that further helps in search engine optimization (SEO). 

Inline Entity Form

Originally created for Drupal 7, the Inline Entity Form is a popular Drupal module that provides a widget for inline management (creation, modification, removal) of referenced entities. The module allows you to create multiple types of content (or other related entities) from a single form and is primarily used to let you manage order items from the order add / edit form.  

Paragraphs

The Drupal 8 Paragraphs module is an author-friendly extension that allows content authors and editors to create flexible and structured content at ease. Using drag and drop functionalities, Paragraphs makes it possible to combine several different fields into a custom reusable element. Moreover, you can add various paragraphs field types such as images, text blocks, quotes, slideshows, videos and so much more.

Advanced Aggregation

The Advanced CSS/JS Aggregation module allows you to enhance the frontend performance of your site by minimizing the CSS and Javascript. The module has the capability to reduce the delivery of the number of files as well as their size. This in turn augments the download and display speed of the entire content of a web page. Not to mention, Advanced CSS/JS Aggregation collects and stores each resource category, thereby consuming less amount of data to download the page. Read Drupal’s effect on high-performance websites to understand more about Drupal’s performance optimization capabilities.

Metatag

The Metatag module plays a significant role as it allows you to automatically provide structured metadata aka "meta tags", about a website. If used in the right manner, Metatags can help you reach your audience in the most natural manner. In addition to this, the module provides support for meta tags (Open Graph Protocol from Facebook, Twitter Cards from Twitter) that have the power to control how content will appear when shared on social networks.

Redirect

The most important part to build a site right is to involve the Redirect Drupal module. The module allows the creation and management of redirects using a simpler user interface. In order to sustain in the long-term, the website must have the ability to create and maintain redirects. Well, this function can be handled perfectly by the Redirect module which creates manual redirects and maintains a canonical URL for all content, redirecting all other requests to that path.

Coffee

Inspired by Mac apps Alfred and Spotlight, the Coffee module allows you to navigate the admin area using your keyboard which is always much faster than a mouse. Just type (alt + D) or (alt + shift + D) using a simple keyboard shortcut, depending on your internet browser, and you are all set to search for the page you are looking to visit, and it will source it in the fewest characters possible.

Entity Reference Revision 

The core Entity Reference module forms the basis of the Entity Reference Revision module that allows you to reference a specific revision of an entity. This Drupal module is presented form the team that brought the Paragraphs model in existence. Besides this, it adds an Entity Reference field type that has revision support and can work in favor of modules like Paragraphs and Inline Entity Form.

Webform

Webform Drupal module is one of the most powerful modules responsible for making forms and surveys available for your users to submit. Once a customizable email is sent to administrators and/or submitters, results can be immediately taken out into Excel or other spreadsheet applications. Moreover, Webform also provides some basic statistical reviews and has an extensive API in-store to further expand its features.

Simple XML sitemap

Search Engine Optimization (SEO) has always been the topmost priority for the Drupal community and therefore tons of modules are created to improve the SEO ranking. Specifically made for Drupal 8, the Simple XML Sitemap module adheres to google’s latest standard and supports multilingual content which makes it even more futuristic and flexible. It also provides an API that allows you to customize links and configurations.

Field group

Field group as the name suggests group fields together which cleans up content types and reduces the burden which falls directly in the lap of content editors. All fieldable entities have the possibility to add groups to wrap their fields together. The main intent of this particular Drupal module is to allow grouping similar fields into tabs, thereby making it easier for people to visualize and deal with the content on the page. 

Fast 404

Drupal suffers from expensive 404 errors which consume more memory of the server to load a page than it should take. This is where the Fast 404 module comes into the picture. Fast 404 Drupal module reduces expensive page rendering without the urge for an additional module. By enabling this module, you can decrease waste bandwidth and server load on-site. In other words, you can deliver 404 errors using less than 1MB of memory on your server. 

403 to 404

403 to 404 refers to a simple Drupal module that emits a 404 error when a user tries to access a page that they don't have access to view.

Modules for development Devel

Being a web developer who is looking for some tools for debugging, the Devel module can be really powerful that any developer would love to improve efficiency. This module is like a compendium of tools with functions that are handy. For example- the ability to create dummy users, nodes, and taxonomy terms as well as easily view information about APIs, cache effectiveness, Views, database queries, and more.

Devel PHP

The Devel module is used to remove the execute feature from the Drupal module. The Devel PHP module allows you to re-use this feature provided by the Admin toolbar by re-adding the executive tool as an external feature. 

Backup and Migrate

Creating a regular backup is an important step to ensure that you don’t lose your data. Drupal is no different and understands this concern. You will be glad to know that Drupal has a dedicated module to look after backup issues that software might face. This module is popularly called the Backup and Migrate module which allows backing up databases, files, codes, etc. This Drupal module is easy and is highly recommended for beginners. Go through the ultimate guide on Drupal 9 to plan a better migration path.

Twig Tweak

Twig Tweak Drupal module is a small module that is accountable to provide a Twig extension with some useful functions. Along with it, the module allows filters that hold the potential to improve the development experience.

Ctools

Ctools is an important module in the Drupal framework which basically is a suite of APIs and tools that can make code readily available with a view to improving the developer experience. This suite comprises a module called the Page Manager who is responsible for managing pages. The usage of Ctools varies from people to people and is highly dependent on the person using it. 

Modules included in core and disabled by default Media 

The Media module is held responsible for the management of creation, editing, deletion, settings, and display of the media entities. The media items generally include images, documents, slideshows, YouTube videos, tweets, Instagram photos, etc.

Media Library

Have you ever wondered if a tool can help you manage media at ease? No? Well for your notice, Media Library is a media management tool that can help you find already existing on your site. Not to mention, the tool can help you make additions of new media items to an entity reference field, or embed media into your content via a text editor. This Drupal module is used in sites which is rich in content, where the media assets can be reused.

Layout Builder

Drupal Layout Builder is a unique module that allows content editors and site builders to create a powerful visual design for displaying content, that too with ease. Using this module, developers can easily and conveniently build page layouts using a UI and allows embedding and linking any elements in layouts (fields, views, menus, and forms). Layout Builder in Drupal 8 gives you access to add/remove sections to display the content using different layouts, and customizing your pages based on the requirements. 

JSON: API

JSON: API is intended to minimize the number of requests and the amount of data transferred between clients and servers efficiently. This Drupal module is of pre-determined nature where everything is pre-fixed. In other words, the possibility of making amends in this module is zero. Be it about the location where the resources will reside, or what methods are immediately available on them. Not to mention, JSON: API provides access control to Drupal Core's permissions system. 

GraphQL 

The GraphQL is a perfect fit for anyone who wishes to raise a query or update/delete any content or configuration. This can be done with the help of the official GraphQL query language.  The GraphQL module is considered as one of the finest as well as a mightier tool of Drupal which can be used as a foundation for building your own schema through custom code or you can use and extend the generated schema using the plugin architecture and the provided plugin implementations form the sub-module.

RESTful Web Services

Inspired by Drupal 7, the RESTful web services module relies on the Serialization module in Drupal 8 core to allow a customizable and extensible RESTful API of data that is managed by Drupal. Surprisingly, this Drupal module provides you to create an interaction with any content entity (nodes, users, comments) as well as closely monitor the database log entries.

Core Multilingual modules

A multilingual site allows developers to access Drupal in a language that they prefer. For this obvious reason, the multilingual component feature of Drupal has become an ideal choice for both businesses and developers. Presently, Drupal offers 4 different modules for language and content translation which can be enabled as per the need of the website.  

Language Module:

This is the base module that is required for any non-English or multi-lingual site. It provides users access to arrange languages and apply languages to content.

Locale (Interface Translation) module:

This particular Drupal module is responsible for translating the built-in user interface, your added modules, and themes.

Content Translation module:

This module provides the translation of content entities. Further, it lets you translate your site content, including pages, taxonomy terms, blocks, etc., into different languages.

Configuration Translation:

It is responsible to allow translation of the text that is part of the configuration, such as field labels, the text used in views, etc.

Migrate

The Migrate module is used to provide a flexible framework for migrating content into Drupal from other sources. For example- converting a site from another CMS to Drupal. Besides this, this module can be easily extended for migrating other kinds of content too.  

Migrate UI

Drupal Migrate UI is responsible to provide the browser user interface (UI) for Migrate Drupal. This Drupal module provides a user interface for editing and configuring migrations to Drupal 8.

Conclusion 

And now that you have reached the end of the blog, we expect you to have some really solid suggestions on your radar. Most importantly, make sure that whatever you figure out should be the best fit for your website and your workflow. 

Think you are ready to take a plunge into Drupal? Contact us at hello@opensenselabs.com and our experts will help you plan and launch your site with ease.

blog banner blog image Drupal Drupal module Blog Type Articles Is it a good read ? On

Wim Leers: The sunset of the API-first initiative

Main Drupal Feed - Thu, 09/10/2020 - 12:29

Mateu, Gabe and I agreed to sunset the API-first initiative, about which I’ve written a lot in 2016–2019.

We’ve all spent countless hours on it — Gabe and I were able to work on it mostly full time, Mateu contributed an incredible amount of his free time to get the API-first initiative and the JSON:API module ecosystem in particular to where it is today.

I learned a lot from these two lovely people, and we also had lots of laughs!

API-first Drupal with multiple consumers @DrupalConNA :D pic.twitter.com/GhgY8O5SSa

— Gábor Hojtsy (@gaborhojtsy) April 11, 2018

Mateu wrote a great retrospective, which is a superb way to end this project. Quoted here in full:

TL;DR: we are putting an official end to the API-first initiative although we don’t consider our work done. The initiative leads have struggled to find availability or energy to keep moving it forward. The upcoming JS components initiative will likely light this flame back up, and we’ll be there to assist and guide in their API endeavors. This patch removes the initiative from the MAINTAINERS.txt.

Connection: close

We mark the API-first initiative done. :wave:.

However, we are not done. There are so many things we would like to improve in Drupal core. Those include hypermedia support, Open API and schema reliability, non-entity JSON:API resources, OAuth2, etc. Nonetheless, we believe that this is a good stopping point for the initiative. We achieved so much, there are so many unforgettable moments. This initiative has played a huge role into transitioning Drupal to the next 10 years of success! We are so proud of what we have accomplished that it has not been easy to wrap it up.

Let’s have HTTP guide us through this decision.

207 (Multi-status)

There is no single definitive reason, but the sum of several reasons have lead us to the unanimous decision to call this initiative done.

202 (Accepted)

JSON:API was the major goal and crowning achievement of the initiative. It was hard to imagine how much work, stress, and personal time that would take from us. As of Drupal 8.7 we can use JSON:API as part of Drupal core. This was the first time we were tempted to call it done.

426 (Upgrade required)

The API-first initiative started with Wim working hard to make REST in core more reliable. In parallel Mateu was writing a myriad of contrib modules bring decoupled Drupal more usable to deliver the expected experiences for customers. In the midst of this Gabe joined the team to help us guide the project to the finish line with the contribution of many volunteers—to whom we are supremely grateful. Thank you! :pray:

It seems this was such a long time ago. Nowadays none of us has the time or the energy to keep tugging this ship. It’s time for a different team to take the lead.

429 (Too many requests)

We recognize that Drupal has a very long road to truly become API-first. On top of that we still have to finish and polish so many key contributed modules. At different points we entertained the idea of adding to core:

  • Consumers.
  • Simple OAuth.
  • JSON:API Hypermedia.
  • Open API.
  • JSON:API Resources.
  • Decoupled Router.
  • Consumer Image Styles.

We probably don’t want them all, but we talked about how very useful they are to the decoupled Drupal endeavour. It is also worth mentioning that there are many other modules that are not very good candidates to Drupal core because they are not broadly applicable enough, while they remain tremendously important to the API-first ecosystem. One obvious example: JSON:API Explorer.

303 (See other)

Dries proposed a new JS components initiative that will likely begin by “solving” decoupled navigation. We vehemently agree that is a great place to start. It is a thorny problem that is not very well solved right now from the API perspective and requires API-first users to reinvent their own solutions over-and-over.

We expect that the JS components initiative team will have to work on the API side in order to complete their goals. We will be there for them, and we will help with code. We hope to be involved as much as we are able to.

Cookie: Contributors=new;

This post was about marking the initiative as done. As such we have talked about the decisions, and the mindset of the initiative coordinators. However, it would be terribly unfair to add this bow on top of the initiative without mentioning the contributors. Everyone that contributed with code, documentation, ideas, designs, support, etc. THANK YOU.

OSTraining: How to Use the Drupal Book Module

Main Drupal Feed - Thu, 09/10/2020 - 04:00

With the Drupal Book module, it is possible to create collections of related pieces of documents presented in a hierarchy. This format is suitable for handbooks and tutorials, for example.

Notice: This module is not for creating ebooks.

The Book module comes by default (disabled) with Drupal core modules, so there is no need to download or install anything additional on your system.

Keep reading to learn how to use this module!

TEN7 Blog's Drupal Posts: TEN7’s Tech Stack

Main Drupal Feed - Wed, 09/09/2020 - 13:30

As TEN7’s Director of Operations, I’ve been working with our team to revamp and document a lot of our internal processes, like our contractor guide and how we handle support requests. As we continue to grow and refine our business processes, we thought it would be valuable to have a document at-the-ready that illustrates the various technologies we use as a company. In other words, TEN7’s Tech Stack.

Amazee Labs: The Business Case for Going Decoupled: Part Two

Main Drupal Feed - Wed, 09/09/2020 - 10:45
<img src="https://www.amazeelabs.com/sites/default/files/styles/leading_image/public/images/current-affairs/The-Business-Case-For-Going-Decoupled--Part-Two_2.jpg?h=994a2424&amp;itok=5eL63yXC" width="1120" height="630" alt="Main article image for The Business Case for Going Decoupled: Part Two blog article." title="The Business Case for Going Decoupled: Part Two" class="image-style-leading-image" /> At Amazee Labs, we’re experts in decoupled web development using Drupal and frontend technologies such as React and Gatsby. Decoupled projects can mean independent Drupal backends, modern frontend web apps or any combination of both working together as full-stack applications. In the first part of this blog series, we explored the advantages of headless Drupal and its applications to various industries. Now we’ll take a look at the frontend advantages of decoupled projects as well as examples where a fully decoupled website can meet all the needs of an elegant complex website.

Specbee: Testing Your Drupal Website just got easier with Behat (A comprehensive tutorial)

Main Drupal Feed - Tue, 09/08/2020 - 10:21
Testing Your Drupal Website just got easier with Behat (A comprehensive tutorial) Samvada Jain M 08 Sep, 2020 Top 10 best practices for designing a perfect UX for your mobile app

“There’s nothing in the world more powerful than a good story”, said the king of wit and wisdom, Tyrion Lannister.

The power of stories and good communication empowers a collaborative and efficient software delivery. Evolving out of agile methodologies, Behavior Driven Development (BDD) technologies leverage this power to the fullest to automate the testing process. Behat is one such BDD technology that enables automated testing using “ubiquitous language”. Let’s learn more about Behat, Mink, Gherkin and how to implement it in Drupal.

What is Behat?

Behat is an open source PHP framework that is used to automate testing by leveraging Behavior Driven Development (BDD). A BDD approach ensures quality software delivery by focusing on continuous communication and simple text stories. With BDD the tester builds test cases in human-readable language. Because of this, it is easy to get the entire team on the same page as everyone, right from the product owner to the developer, can understand and get continuous feedback about the current scenario. 

What is Gherkin?

The language used by the Behat tool is Gherkin, which is a business readable and domain-specific language. Gherkin also serves as a living documentation and reports can be generated to document each test run. This simple whitespace-based language uses simple language words as keywords. Indentations (using space/tab) and line endings define the structure for the test case. Although writing and understanding the language is easy, the end result should focus on enabling better collaboration, efficiency, automation and traceability. Test cases should be written intuitively, focus on important elements, avoid checking duplicate records and use good grammar.

What is Mink?

Mink is an open source browser controller that simulates a test scenario with the web application. Once the test cases are written, it needs to be executed and emulate user actions. With Mink, you can use the same test scenario and run it on various browser emulators like Goutte, Selenium, Chrome, Zombie, and more. While installing the Behat Drupal extension, you will see a dependency on Mink so make sure you have it installed as well.
Installation and usage of Behat Drupal
The official way to install Behat in your system is through Composer. Not only can it install Behat for you, but it will also be able to easily update you to the latest version later when one comes out.

•    Inside the project folder, run the command: 

$ composer require behat/behat

•    Or inside your composer.json file, add the require statement

"require": { "behat/behat": "^3.0.0", “phpunit/phpunit”: “^5.0.0” } • Next, run composer install command in the terminal. • When it is done, you will also notice a new directory bin/ with a Behat file in it. This is the Behat executable and you will use it to run your tests and get debug information. • Next, create a file named behat.yml inside the root folder of the project. When Behat runs, it looks for a behat.yml file, which it uses for its configuration. default: suites: default: contexts: - Drupal\DrupalExtension\Context\DrupalContext extensions: Behat\MinkExtension: goutte: ~ base_url: http://example.org/ # Replace with your site's URL Drupal\DrupalExtension: blackbox: ~

To initialize the project, run the command: 

vendor/bin/behat –init

This creates a features/ folder and a bootstrap/FeatureContext.php default context file inside the features/ folder.

Writing Stories and Running tests with Behat

Our goal is to describe the stories in the most effective way. The stories are written in a human-readable language, Gherkin, with the extension .feature under the features/ directory.

Let’s imagine that you need to test whether you can add content to the Basic page content type in your site successfully or not. To do that, you must have access to the page to fill the fields and save it as an administrator. 

So, let’s write our first story:

Feature: Check basic page CT In order to create a page As an admin I want to access /node/add/page So that I can create a page Scenario: Basic Page CT Given I am logged in as a user with the "administrator" role When I go to "/node/add/page" And I enter "Basic page title" for "edit-title-0-value" When I press "edit-submit" Then I should see "Basic page Basic page title has been created"

This file can be named basic_page.feature. Each feature can have many scenarios, which describe the specific behavior of the feature. Each scenario will have sections: 
•    Given - details the starting state of the system
•    When - includes the action the user takes
•    Then - describes what the user sees after taking action
•    And - to maintain the connectivity in the scenario. 
There is not much difference between Then, And, and But. These words are made available to make your scenarios natural and readable.

All feature files can be run by vendor/bin/behat. If you want to run a specific feature file, run vendor/bin/behat features/basic_page.feature. There is also a way to run a single scenario by just adding a line number where the scenario is defined: vendor/bin/behat features/basic_page.feature:11.

There are commands like vendor/bin/behat -dl which provides you all the statement syntax that is used in scenarios and vendor/bin/behat -di provides the syntax along with the examples.

How to write Feature files Behat runs curl requests against URLs on your website, which makes the testing process quite fast, but also makes Behat lose the ability to test features that require Javascript. So, to test features we only need to do add @javascript tag before every scenario that requires Javascript, like this: Feature: Check basic page CT In order to create a page As an admin I want to access /node/add/page So that I can create a page @api @javascript Scenario: Basic Page CT Given I am logged in as a user with the "administrator" role When I go to "/node/add/page" And I enter "Basic page title" for "edit-title-0-value" And I fill in wysiwyg on field "edit-body-0-value" with "Basic page content" When I press "edit-submit" Then I should see "Basic page Basic page title has been created"


To test this, run vendor/bin/behat. This will show you the undefined steps in the scenarios because the scenarios must map to a function.


You can either copy-paste the code snippet to the context file FeatureContext.php or run vendor/bin/behat --dry-run --append-snippets

Then you can write the definitions for the functions in FeatureContext.php as shown:

<?php use Behat\Mink\Exception\ExpectationException; use Drupal\DrupalExtension\Context\RawDrupalContext; /** * Defines application features from the specific context. */ class FeatureContext extends RawDrupalContext { /** * The mink context. * * @var Drupal\DrupalExtension\Context\MinkContext */ protected $minkContext; /** * Initializes context. * * Every scenario gets its own context instance. * You can also pass arbitrary arguments to the * context constructor through behat.yml. */ public function __construct() { } /** * Fill in wysiwyg on field. * * @Then I fill in wysiwyg on field :locator with :value */ public function iFillInWysiwygOnFieldWith($locator, $value) { $el = $this->getSession()->getPage()->findField($locator); if (empty($el)) { throw new ExpectationException('Could not find WYSIWYG with locator: ' . $locator, $this->getSession()); } $fieldId = $el->getAttribute('id'); if (empty($fieldId)) { throw new Exception('Could not find an id for field with locator: ' . $locator); } $this->getSession() ->executeScript("CKEDITOR.instances[\"$fieldId\"].setData(\"$value\");"); } }

Now, run the command vendor/bin/behat and all the scenarios that are written must pass. The defined JS function will map the scenario statement “And I fill in wysiwyg on-field "edit-body-0-value" with "Basic page content".

Behat has many benefits that help all those who are included in the software development process, starting with developers themselves over project managers to clients. Implementing Behat in Drupal allows for an efficient and systematic approach in building amazing Drupal experiences. However, Behat testing also comes with some cons along with tons of pros. It requires effort to make them robust and the processing is comparatively slower. But it also ends up saving a lot of time by enabling you to run the features over and over again. Looking for a Drupal development company that leverages the best of modern technologies to create compelling digital solutions? Contact us now!

Drupal Planet Drupal Drupal Tutorial Drupal Development Shefali ShettyApr 05, 2017 Subscribe For Our Newsletter And Stay Updated Subscribe

Leave us a Comment

  Shefali ShettyApr 05, 2017 Recent Posts Image Testing Your Drupal Website just got easier with Behat (A comprehensive tutorial) Image Design VS Code – Why should they go hand-in-hand? Image Integrating the Sharethis Block Module with Drupal 8 - A Comprehensive Tutorial Want to extract the maximum out of Drupal? TALK TO US Featured Success Stories

Know more about our technology driven approach to recreate the content management workflow for [24]7.ai

link

Find out how we transformed the digital image of world’s largest healthcare provider, an attribute that defined their global presence in the medical world.

link

Discover how a Drupal powered internal portal encouraged the sellers at Flipkart to obtain the latest insights with respect to a particular domain.

link

Srijan Technologies: Fundamentals of Drupal Monolog Module

Main Drupal Feed - Mon, 09/07/2020 - 12:25

In a typical scenario of staging or production, developers seldom have the option to use the debugger so they turn to the logging functionality to resolve system issues.

ADCI Solutions: The importance of website maintenance

Main Drupal Feed - Mon, 09/07/2020 - 11:44

As the old Russian proverb says - repair your cart in December, in July your sled remember. Hence, it is the right time to start support and maintenance for your website. ADCI Solutions has prepared an upgrade planning checklist for Drupal website owners. For your convenience, we have attached a checklist in PDF format on our website. Download it to your desktop and check your website on time.

Enjoy the article: "The importance of website maintenance"

Matt Glaman: My PHPUnit configuration for my Drupal projects

Main Drupal Feed - Mon, 09/07/2020 - 02:49

The other week, I was asked about how I maintain my PHPUnit config file for my Drupal projects. When running Drupal's PHPUnit test suites, you typically copy and modify the distribution phpunit.xml.dist file which lives in the web/core subdirectory. There is just one problem. This directory is technically a vendor directory and is replaced during any updates to the drupal/core dependency of your Drupal project. Every minor version will cause your file to reset, or anytime you install dependencies if Drupal core is patched.

One thing I noticed is that since I first followed your tuts a while back, my phpunit.xml is gone.  I'm guessing it gets overwritten when core is updated.  Do you just keep a copy of the file and paste it in when that happens? Is there a better solution?

Matt Glaman: My PHPUnit configuration for my Drupal projects

Main Drupal Feed - Mon, 09/07/2020 - 02:49

The other week, I was asked about how I maintain my PHPUnit config file for my Drupal projects. When running Drupal's PHPUnit test suites, you typically copy and modify the distribution phpunit.xml.dist file which lives in the web/core subdirectory. There is just one problem. This directory is technically a vendor directory and is replaced during any updates to the drupal/core dependency of your Drupal project. Every minor version will cause your file to reset, or anytime you install dependencies if Drupal core is patched.

One thing I noticed is that since I first followed your tuts a while back, my phpunit.xml is gone.  I'm guessing it gets overwritten when core is updated.  Do you just keep a copy of the file and paste it in when that happens? Is there a better solution?

OpenSense Labs: How Open Source Thrives During Economic Slump?

Main Drupal Feed - Sun, 09/06/2020 - 12:40
How Open Source Thrives During Economic Slump? Gurpreet Kaur Sun, 09/06/2020 - 18:10

The economic difficulties the world is facing in the post-covid-19 world can be attributed as severe as the Great Recession. There is no doubt that we will be able to recover in the coming years, but what of the present? More people have lost jobs than ever before and many employers are still continuing to downsize in order to become equipped to battle the slump. 

Amidst such economically turbulent times, would it be wishful thinking to consider that there is a segment in the market that is still continuing to grow? I do not think so. But, open Source and everything it entails is flourishing despite the market’s downfall. And the best part is that it is not flourishing alone, it is doing so with its entire community.

Let us have a look at the aspects of Open Source that have made it immune to economic slump.

Driven by strong values Drupal's values and principles | Source: Dries Buytaert's blog

Open Source software is always being moulded by its community of users. The strong values and principles set by an open source software for its members to uphold are instrumental. These help them make better decisions, let them be their best selves and leap forward as a unified community.

Talking about the values and principles, we have to look no further than Drupal - one of the leading open source CMSes in the global market. It has very strong values backing it and it is these values that make it as successful as it is, despite the economic downturns. I will mention a value that Drupal stands upon and you will understand my point.

Drupal believes in fostering a learning environment, wherein both the veteran contributors and the amateurs are treated with the same level of respect. Asking the right questions is the first step of learning, and if you are hesitant to do that, then learning can become difficult. At Drupal, no question is regarded as bizarre or frowned upon, whatever you ask will be answered with the utmost sincerity. The contributors, who have been with Drupal for years act as role models and pave the way for the novices to take their place one day.

When learning and self growth are the ultimate goal, the state of the economy does not hold much prominence. Consequently, the contributors grow and the open source grows with their contributions.

Less vulnerable on the financial front

Do you know which are the two most lucrative periods of growth for open source software? These are the years 2000 and 2008. And do you know what these two years remind us of? These were the years when The Dot Com Crash and The Great Recession happened. 

Now the question arises, how can open source experience its most growth in times when the world was battling two of the biggest financial crises? The answer lies in its economic costs.

Open source software is free for all, unlike proprietary software, which mandates exorbitant investment. Free means less financial burden on the companies using it. Since economic slump is all about saving as many pennies as you can, open source becomes just the way to do it. With constrained budgets and cost-effectiveness the only things running through people’s minds, the solution can only be found with open source. Perhaps that is why, when companies were falling down like the domino effect, Red Hat, a public open source company, increased its revenue by 11% every year in The Great Recession. 

The Coronavirus pandemic in 2020 is indeed doing the same for open source. After almost 20 years of growth and after battling two recessions open source has only become stronger and more resilient.

Preference for widely adopted commodity tool Save a huge amount of money by simply implementing an already established software like Drupal rather than building something from the ground up.

When times are difficult on the financial front, people and organizations try to make up for the difficulties by easing other dimensions of their operations. A great way of doing just that is by adopting open source software. 

An open source software has the potential of solving a couple of dilemmas for its users. Primarily, it will help the users save a ton of financial resources by simply implementing an already established software like Drupal rather than building something from the ground up. And it's not just money, making something from scratch is going to put a lot of strain on the human resources of an organisation as well.

On top of that, it also allows room for liberty. Using an open source software will not make you reliant on any one organisation like proprietary software would. If Microsoft goes out of business, your reliance on it will make things all the more difficult for you. However, the chances of open source software going bankrupt are slim to none, since it is not in business for money.

So, during an economic downturn, many companies opt for open source software because of the cost-effectiveness and security it is going to provide and the open source community flourishes.

The case for faster innovation

Let us start with an example. Have you ever been in a group study? And you must have studied alone as well? Can you think of a difference between the two? Which one clarifies your doubts more? Which one widens your learning parameters? The majority of you would answer with group study, and the reason is one simple fact, when there are more people, there are more ideas.

The same is applicable for open source software and proprietary software, wherein the open source is the equivalent of group study. There are hundreds and thousands of people from all over the world involved in open source software and its development, while the proprietary software development team cannot exceed the number of employees in its organization and even that’s a stretch.

What does this mean then? If you ask me, I would say that open source software and companies using it are faster at innovation because of their enormous number of contributors. Open source’s innovative powers are not limited to a single person or organization, they stretch onto the entire world population. Someone sitting in Italy can think of an additional feature and a coder sitting in his home in Australia can add a few improvements to the same. Is this not the best way to strive for innovation?

More open source contributions  When developers get unemployed during economic slumps, they participate in open source as a way to develop or extend skill sets.

Economic downturn is bound to bring along massive unemployment. During the Covid-19 pandemic millions have lost their jobs. Losing a job does not have to be a bad omen, at least not every time. After all it is often said, when a door is closed, another one opens right up. Open source organisations are that other door. 

We all know that open source companies are immensely reliant on the contributions of its community. Majority of the upgrades and improvements are because there are contributors all over the world making them happen and that is how open source companies grow.

Now, coming to the economically difficult times and unemployment, when a coder or a designer loses his job, he has more time on his hands. So, what can he do with that time? Can he direct it towards finding ways to improve his skill set by working on open source platforms? He sure can. Along with honing his skills, a coder will also learn about new technologies, improving his chances of getting a new job and help open source in providing a better user experience. A win-win situation for both of them. It’s not just me who thinks that, the founder of Drupal, Dries Buytaert also believes that. In an interview with TechRepublic, he said that when developers get unemployed during economic slumps, they “participate in open source as a way to develop or extend skill sets.” Read how you can get involved with the Drupal project here.

Open source experiences an increased number in its contributors during economic downfalls. It happened in 2000, in 2008 and it has happened in the 2020 Covid-19 Pandemic. To know more, check out the perks of contributing to open source projects.

Efficiently beats the pandemic 


It is true, Drupal had suffered a shortfall of almost half a million dollars during the COVID-19 crisis, the future seemed rather too bleak. However, Drupal’s community did not allow the bleakness to stretch on for long. Within a span of 30 days, the community, inclusive of organizations, both big and small, and individuals, was able to raise $500,000. From the Australian Government to the National Portal of India, Drupal users have shown consistent support for the Drupal Association and let it beat the pandemic. To know more, check out how Drupal is fighting against Covid-19 and the effects that the pandemic had on Drupal.

Other open source organisations like Confluent, Redis Labs and Cloudera have also been able to raise considerable amounts of money to support their operations in the COVID times. Instead of slowing down in an economic downturn, these organisations are thriving. Take a look at the power of open source in the time of Covid-19 to know more.

The Bottom Line 

The economic slump is indeed a battle for all of us, but I would say that open source is immune to it. The primary reason is the fact that open source is not in business for money, it is in business to help people and organisations grow and innovate by helping each other. The current market situation will only impact you when your business is reliant on its flourishments, however, open source does not need it to be in its pristine state. So, whether there is an economic downturn or not, open source will continue to grow.

blog banner blog image Open Source Drupal Covid-19 Coronavirus Blog Type Articles Is it a good read ? On

OpenSense Labs: How Open Source Thrives During Economic Slump?

Main Drupal Feed - Sun, 09/06/2020 - 12:40
How Open Source Thrives During Economic Slump? Gurpreet Kaur Sun, 09/06/2020 - 18:10

The economic difficulties the world is facing in the post-covid-19 world can be attributed as severe as the Great Recession. There is no doubt that we will be able to recover in the coming years, but what of the present? More people have lost jobs than ever before and many employers are still continuing to downsize in order to become equipped to battle the slump. 

Amidst such economically turbulent times, would it be wishful thinking to consider that there is a segment in the market that is still continuing to grow? I do not think so. But, open Source and everything it entails is flourishing despite the market’s downfall. And the best part is that it is not flourishing alone, it is doing so with its entire community.

Let us have a look at the aspects of Open Source that have made it immune to economic slump.

Driven by strong values Drupal's values and principles | Source: Dries Buytaert's blog

Open Source software is always being moulded by its community of users. The strong values and principles set by an open source software for its members to uphold are instrumental. These help them make better decisions, let them be their best selves and leap forward as a unified community.

Talking about the values and principles, we have to look no further than Drupal - one of the leading open source CMSes in the global market. It has very strong values backing it and it is these values that make it as successful as it is, despite the economic downturns. I will mention a value that Drupal stands upon and you will understand my point.

Drupal believes in fostering a learning environment, wherein both the veteran contributors and the amateurs are treated with the same level of respect. Asking the right questions is the first step of learning, and if you are hesitant to do that, then learning can become difficult. At Drupal, no question is regarded as bizarre or frowned upon, whatever you ask will be answered with the utmost sincerity. The contributors, who have been with Drupal for years act as role models and pave the way for the novices to take their place one day.

When learning and self growth are the ultimate goal, the state of the economy does not hold much prominence. Consequently, the contributors grow and the open source grows with their contributions.

Less vulnerable on the financial front

Do you know which are the two most lucrative periods of growth for open source software? These are the years 2000 and 2008. And do you know what these two years remind us of? These were the years when The Dot Com Crash and The Great Recession happened. 

Now the question arises, how can open source experience its most growth in times when the world was battling two of the biggest financial crises? The answer lies in its economic costs.

Open source software is free for all, unlike proprietary software, which mandates exorbitant investment. Free means less financial burden on the companies using it. Since economic slump is all about saving as many pennies as you can, open source becomes just the way to do it. With constrained budgets and cost-effectiveness the only things running through people’s minds, the solution can only be found with open source. Perhaps that is why, when companies were falling down like the domino effect, Red Hat, a public open source company, increased its revenue by 11% every year in The Great Recession. 

The Coronavirus pandemic in 2020 is indeed doing the same for open source. After almost 20 years of growth and after battling two recessions open source has only become stronger and more resilient.

Preference for widely adopted commodity tool Save a huge amount of money by simply implementing an already established software like Drupal rather than building something from the ground up.

When times are difficult on the financial front, people and organizations try to make up for the difficulties by easing other dimensions of their operations. A great way of doing just that is by adopting open source software. 

An open source software has the potential of solving a couple of dilemmas for its users. Primarily, it will help the users save a ton of financial resources by simply implementing an already established software like Drupal rather than building something from the ground up. And it's not just money, making something from scratch is going to put a lot of strain on the human resources of an organisation as well.

On top of that, it also allows room for liberty. Using an open source software will not make you reliant on any one organisation like proprietary software would. If Microsoft goes out of business, your reliance on it will make things all the more difficult for you. However, the chances of open source software going bankrupt are slim to none, since it is not in business for money.

So, during an economic downturn, many companies opt for open source software because of the cost-effectiveness and security it is going to provide and the open source community flourishes.

The case for faster innovation

Let us start with an example. Have you ever been in a group study? And you must have studied alone as well? Can you think of a difference between the two? Which one clarifies your doubts more? Which one widens your learning parameters? The majority of you would answer with group study, and the reason is one simple fact, when there are more people, there are more ideas.

The same is applicable for open source software and proprietary software, wherein the open source is the equivalent of group study. There are hundreds and thousands of people from all over the world involved in open source software and its development, while the proprietary software development team cannot exceed the number of employees in its organization and even that’s a stretch.

What does this mean then? If you ask me, I would say that open source software and companies using it are faster at innovation because of their enormous number of contributors. Open source’s innovative powers are not limited to a single person or organization, they stretch onto the entire world population. Someone sitting in Italy can think of an additional feature and a coder sitting in his home in Australia can add a few improvements to the same. Is this not the best way to strive for innovation?

More open source contributions  When developers get unemployed during economic slumps, they participate in open source as a way to develop or extend skill sets.

Economic downturn is bound to bring along massive unemployment. During the Covid-19 pandemic millions have lost their jobs. Losing a job does not have to be a bad omen, at least not every time. After all it is often said, when a door is closed, another one opens right up. Open source organisations are that other door. 

We all know that open source companies are immensely reliant on the contributions of its community. Majority of the upgrades and improvements are because there are contributors all over the world making them happen and that is how open source companies grow.

Now, coming to the economically difficult times and unemployment, when a coder or a designer loses his job, he has more time on his hands. So, what can he do with that time? Can he direct it towards finding ways to improve his skill set by working on open source platforms? He sure can. Along with honing his skills, a coder will also learn about new technologies, improving his chances of getting a new job and help open source in providing a better user experience. A win-win situation for both of them. It’s not just me who thinks that, the founder of Drupal, Dries Buytaert also believes that. In an interview with TechRepublic, he said that when developers get unemployed during economic slumps, they “participate in open source as a way to develop or extend skill sets.” Read how you can get involved with the Drupal project here.

Open source experiences an increased number in its contributors during economic downfalls. It happened in 2000, in 2008 and it has happened in the 2020 Covid-19 Pandemic. To know more, check out the perks of contributing to open source projects.

Efficiently beats the pandemic 


It is true, Drupal had suffered a shortfall of almost half a million dollars during the COVID-19 crisis, the future seemed rather too bleak. However, Drupal’s community did not allow the bleakness to stretch on for long. Within a span of 30 days, the community, inclusive of organizations, both big and small, and individuals, was able to raise $500,000. From the Australian Government to the National Portal of India, Drupal users have shown consistent support for the Drupal Association and let it beat the pandemic. To know more, check out how Drupal is fighting against Covid-19 and the effects that the pandemic had on Drupal.

Other open source organisations like Confluent, Redis Labs and Cloudera have also been able to raise considerable amounts of money to support their operations in the COVID times. Instead of slowing down in an economic downturn, these organisations are thriving. Take a look at the power of open source in the time of Covid-19 to know more.

The Bottom Line 

The economic slump is indeed a battle for all of us, but I would say that open source is immune to it. The primary reason is the fact that open source is not in business for money, it is in business to help people and organisations grow and innovate by helping each other. The current market situation will only impact you when your business is reliant on its flourishments, however, open source does not need it to be in its pristine state. So, whether there is an economic downturn or not, open source will continue to grow.

blog banner blog image Open Source Drupal Covid-19 Coronavirus Blog Type Articles Is it a good read ? On

Coral

Drupal Themes - Sat, 09/05/2020 - 13:02

A subtheme for Drupal's new administration theme Claro. It features minor css tweaks for prettier status messages, condensed UI elements and thinner sidebars.

Oliver Davies: Upgrading the Dransible project to Drupal 9

Main Drupal Feed - Sat, 09/05/2020 - 09:00
Upgrading the Dransible project to Drupal 9 opdavies 5th September 2020

This week I gave a new talk on upgrading to Drupal 9 for the Drupal NYC meetup. Whilst preparing for that, I decided to upgrade my Dransible example project that I use for my Ansible and Ansistrano talk to Drupal 9 and document the process.

Whilst the steps taken are in the slides for that talk, here is the full list of steps that I took including the Composer commands.

Updating from Drupal 8.8 to 8.9

To begin with, let's update to the latest version of Drupal 8 so that we can do some testing and see all of the latest deprecation notices before moving to Drupal 9.

  1. Remove Drush temporarily using composer remove drush/drush as it will cause us being stuck on Drupal 8.9.0-beta2 rather than a newer, stable 8.9 version.
  2. Update ^8.8 to ^8.9 in composer.json for drupal/core-recommended, drupal/core-dev and drupal/core-composer-scaffold, and run composer update drupal/core-* --with-dependencies to update core to 8.9.5.
  3. Re-add Drush so that it's present for the deployment by running composer require drush/drush:^9.
Preparing for Drupal 9
  1. Add the Upgrade Status module by running composer require drupal/upgrade_status.
  2. Upgrade to Drush 10 by running composer require drush/drush:^10.
  3. Remove the Config Installer module by running composer remove drupal/config_installer. This is no longer needed since Drupal 8.6, and there will be no Drupal 9 version.
  4. Update the Admin Toolbar module to 2.3, a Drupal 9 compatible version, by running composer update drupal/admin_toolbar.

As I'd previously updated the Simple Message custom module to be Drupal 9 compatible (adding the core_version_requirement key to the info.yml file, and removing usages of deprecated code), no changes needed to be made to that.

Upgrading to Drupal 9
  1. Update ^8.9 to ^9.0 for the core packages in composer.json, and run composer update drupal/core-* --with-dependencies to update to 9.0.5.
  2. Re-add Drush by running composer require drush/drush. This will install Drush 10 by default.
Post upgrade

Although everything seemed to have updated OK locally, there were some errors when running a deployment to the Vagrant virtual machine that needed to be addressed, as well as some post-upgrade housekeeping steps to perform.

  1. Fix the deployment error by adding the Symfony Configuration component as a dependency by running composer require symfony/config:^4.
  2. Alias Drupal\Core\Messenger\MessengerInterface to messenger in simple_message.services.yml to fix the autowiring error.
  3. Add settings["config_sync_directory"] to settings file variables (this will be added automatically in the next version of the Drupal settings Ansible role).
  4. Remove the Upgrade Status module by running composer remove drupal/upgrade_status, as it's no longer needed.

And that's it! The Dransible demo project is upgraded, and if you see my Ansible deployments talk in the future, the demo site will be running on Drupal 9.

If you want to see the original pull request, it's at https://github.com/opdavies/dransible/pull/7.

Tags Composer Dransible Drupal Drupal 9 Drupal Planet PHP

Chapter Three: A review of multiple site architecture options in Drupal

Main Drupal Feed - Fri, 09/04/2020 - 17:28

Oftentimes projects need a way to serve multiple domains from the same installation or from the same codebase. In Drupal we have several ways to accomplish this, and this post will describe some architecture options that make this possible, as well as the relevant factors that can help you decide which option provides the best ‘fit’ for the implementation.

We’ll be looking at four distinct implementation choices: Classic Drupal Multisite, Domain Access or Mega Site, Distribution Profile, and an offshoot of the distribution profile called Custom Upstream.

Matt Glaman: Do you need a Functional test for that?

Main Drupal Feed - Fri, 09/04/2020 - 17:03

Drupal has four PHPUnit test suites: Unit, Kernel, Functional, and FunctionalJavascript. Each test suite offers various levels of integration with the Drupal code base.

Matt Glaman: Do you need a Functional test for that?

Main Drupal Feed - Fri, 09/04/2020 - 17:03

Drupal has four PHPUnit test suites: Unit, Kernel, Functional, and FunctionalJavascript. Each test suite offers various levels of integration with the Drupal code base.

Pages