gareth's blog

Creating a Simple Location-Based Proximity Search in Drupal

Introduction

Most available documentation for creating location-based searches in Drupal is either outdated or overly focused on complex map implementations. This can make implementing even a basic store locator challenging for developers approaching the task for the first time.

Connect to a DDEV database in PHPStorm

To connect to the DDEV database from within PHPStorm, the first step is to define the database container port. This is needed to ensure the connection credentials don't change between restarts of DDEV.

PHP Authentication Shield configuration

PHP Authentication shield (https://www.drupal.org/project/shield) is great for blocking access to dev and stage sites, so I thought I'd document how I have it setup.

I usually have it installed and enabled on the Dev and Stage environments by default, it can be disabled or uninstalled if needed, but i set up my config split to ensure it is install and enabled (for dev and stage) but completely uninstalled on Prod after a deployment thanks to drush config:import running automatically as a part of the deployment process.

Testing HTTP Headers

I was recently asked to change a header to ensure that requests always use https, this can be done by ensuring the webpage has the header "Upgrade-Insecure-Requests” and that should be set to true. This can be achieved using SecKit, but I needed a way to check the initial setting and then also the change.

To view either the request or response HTTP headers in Google Chrome, I can do the following:

drush examples for dumping a database

In a second part to the drush examples post last month, I thought I should also share the DB commands I have been using to ensure they don't get lost either.

This time I am using drush manual regarding the the drush configuration options (https://www.drush.org/12.x/using-drush-configuration/#non-options):

drush examples for moving files around

As I move more sites from D7 to D9 and D10 I have been playing more and more with some drush commands to move the DBs and files around I thought I would capture some here to ensure they don't get lost.

To ensure only the necessary files are copied without any extraneous ones I found this in the drush manual (https://www.drush.org/12.x/site-aliases/):

Great Mistakes in Technical Leadership – reprint of a reprint

Second Reprinting of: Mroodles – Great Mistakes in Technical Leadership – reprint

Great Mistakes in Technical Leadership - 11 Jun 2006

http://www.mroodles.com/wordpress/hacking/great-mistakes-in-technical-le...

but that site is now gone. I found this text in Wayback machine and took the liberty of posting it here with some grammar fixes (American English to English).

Originally: Hacknot – Great Mistakes in Technical Leadership

Drupalcon Portland watchlist

Having missed another drupalcon, I am eagerly awaiting the publishing of the videos that I missed online, to watch at my leisure.

In the meantime, I thought I would revisit and catch up with the videos I didn't get around to watching from drupalcon Portland 2022.
The schedule is here:
https://events.drupal.org/portland2022/schedule/2022-04-25

But the videos are available on the Drupal Association Youtube channel.

How to add a fork to a composer Project

There are occasions when a project is needed that isn’t yet ready for Drupal 8 or 9. Hopefully, it is only missing a couple of configuration options like the the new core_version_requirement key in *.info.yml, but sometimes it needs more work.

Pages

Subscribe to RSS - gareth's blog