nerdfisch: DevBits

Kleine, aber feine Code-Snippets, nützliche Tweaks und elegante Lösungsansätze aus dem Entwickler-Alltag

26.03.2026 | Pascal Crott

Clear plugin manager cache

my_module.module
\Drupal::service('plugin_id.manager')->clearCachedDefinitions();
// Clear entity_type plugin cache.
\Drupal::entityTypeManager()->clearCachedDefinitions();
cache
plugins
26.03.2026 | Dominik Wille

Quick start: module testing on drupal.org

add-gitlab-ci.sh
curl https://git.drupalcode.org/project/gitlab_templates/-/raw/main/gitlab-ci/template.gitlab-ci.yml > .gitlab-ci.yml

sh
automated tests
drupal
modules
19.03.2026 | Peter Gerken

Block raw network access for a container

docker-compose.offline.yml
services:
  web:
    cap_drop:
      - NET_RAW
yml / yaml
local development
docker
copy-paste
19.03.2026 | Michael Ebert

Preview changed config before import/export with drush

First, you could check if there are different states of your config between database and local file system.

drush_config_status.sh
drush config:status

There is an option `--diff` for the drush command that will print the changes first.

drush_config_import_diff.sh
drush config:import --diff

This also works for config export.

drush_config_export_diff.sh
drush config:export --diff
drush
config
configuration management
local development
12.03.2026 | Pascal Crott, Michael Böker

Convert MySQL 8 Database Dump to MariaDB

mysql8 to mariadb.sh
cat olddump.sql | sed -e s/uca1400_as_ci/utf8mb4_general_ci/ | gzip > newdump.sql.gz
sh
mysql
mariadb
copy-paste
databases