Blogs

Setting up DDEV on a Mac using Colima

This post will guide you through the process of setting up DDEV on a Mac using Colima, an open-source Docker provider. As a developer, setting up a local development environment can be a daunting task, especially when working with complex projects like Drupal. Fortunately, tools like DDEV and Colima make it easy to get started quickly and efficiently. Note that there are alternative paid Docker providers available, such as Docker Desktop and OrbStack etc.

0/5

How to submit a form from another submit handler.

In some cases, we might want to modify the form submission behaviour to better fit a particular use case. For instance, we would like to offer our own submit handler, and we will contact the original submit handler under specific circumstances.

Here, we'll utilise the module name example to change the way a form submits when its form ID is demo_form, which is provided by demo module. To do this, we'll create the code that follows in example.module file:

5.0/5

How to use the Drupal 9 module in a Drupal 10 project using Composer if its MR is already ready for Drupal 10 compatibility

We have often found that in the Drupal 9 project, multiple modules are not compatible with Drupal 10, and when we check the module issue queue, especially with the term "Automated Drupal 10 compatibility fixes", we can find at least one issue where the project update bot creates this issue automatically against each module and provides a patch with possible fixes except for making changes in module.info.yml.

0/5

How to create pager in drupal 8/9 for custom data set

Sometimes we need to create a pager for custom data sets, such as retrieving specific types of nodes and applying a filter on top of it to get the expected data set.

In this post, I am going to create a custom Drupal module named pager_example, which will create a pager for a custom data set.

Register a path where we will display a page with a pager using a custom data set. For that, I am going to create a routing file with the name "pager_example.routing.yml", which will have the following snippet:

0/5

Setup development environment for Drupal on windows 10

Being a Drupal developer, I would prefer to work on a Mac or Linux (Ubuntu) operating system for fast and hassle-free development work, but sometimes you will not get such preferences, may be due to organizations’ norms.

Assume you have a Windows machine for local development and have been assigned to a Drupal project, and you have now configured your local machine for the Drupal project.

In this post, I'll walk you through the steps for setting up a local development environment for Drupal.

0/5

Use of Drupal module uninstall validators and lazy services

Sometimes we do not want users to uninstall a Drupal module directly, but instead want to perform some checks first.

Let's take a scenario where installing a custom module creates node types along with some fields. Later on If a user wishes to uninstall that module (assuming some content has already been created on the site using the node types that are created by this module), then uninstalling that module can cause a serious problem. It should ask the user to delete the content first that has been created on the site using these node types before uninstalling the module.

0/5