David Valdez's blog

Avoid sending emails while doing a migration on Drupal 8

During a migration, Drupal reads the data from an external source and creates content in our new Drupal Site. While doing that, Drupal executes all hooks and events related to creating the new content. So any implementations of hook_entity_insert() are triggered for every new entity saved on our new site.

Doing links on Drupal 8

There are plenty of ways to create links when using Drupal 8 and I will share some of those ways in this post.

The easiest way to create internal links is using Link::createFromRoute

And it is used like this:

Start contributing to Drupal

I’ve been working on open source projects for a long time and contributing to Drupal for 6 years now.

And I want to share my experience and the things that helped me contribute to Drupal.

Migration from WebTestBase to BrowserTestBase

The UnitTest initiative wants to get rid of the Drupal-only Simpletest module. To do this it is necessary to update the functional tests of our modules to stop using the WebTestBase (WTB) class, which is part of the Simpletest module.

Now we need to use the BrowserTestBase (BTB) class and migrate the tests from one to the other.

Migrating from WTB to BTB is relatively straightforward (unless you have to use something which hasn’t been ported yet.

Redirect users after login to the page they were viewing in Drupal 8

Have you ever been asked to log into a website while you are viewing a page? And after doing so you get redirected to some page other than the one you were reading? This is an obvious and rather common usability problem. When this happens people lose track of what they were doing and some might not even bother to go back. Let's find out how to solve this in Drupal 8.