All Articles
Handle configuration settings in custom Drupal modules and example of using the configuration API in Drupal
Handling configuration settings in custom modules involves using the Configuration API provided by Drupal. This API allows you to define, manage, and access configuration settings in a structured and consistent way. Here’s how I approach it and an example of using the Configuration API in Drupal 10/11:
Using the Configuration API
Keycloak: How to override the password reset emails
In order to override the text of the password reset emails in Keycloak, you want to do the following.
Make your own copy of the default themes. These can currently be found at: https://github.com/Halazv2/keycloak-theme/tree/master/themes/base/email
Then, make changes to the theme as appropriate. There are several themes: the login theme stores the styling of the login pages. But the email theme contains the wording of the emails.
Default Drupal file attachment types
I have the following list of extensions that I usually permit in drupal attachments:
txt pdf doc docx html csv xlsx xlsm sh json
cer pem pub key
png jpg jpeg gif
mkv sfv avi mp3 mp4 webm mov
zip tar gzConverting mbox to maildir
From Mellowhost blog.
mbox and maildir both are popularly used techniques to store mails. The simple way to understand the difference is, mbox uses a single directory to store all mails while maildir would utilize a directory structure to store mails. Most of the cases, advance mail receiving techniques IMAP over POP3 uses these sort of folder based concept to provide enhancement in mail organizing.
[FIXED]: drush The specified database connection is not defined: default
Fixing this took me years... I can't believe how long it took. The answers on stack overflow did not help.
The error was due to a mismatching php configuration for running in the shell ( /etc/php/8.1/cli/php.ini ) and in apache (/etc/php/8.1/apache2/php.ini ).
Specifically, I had to enable short tags for the shell:
pnpm, nvm installation
npx pnpm i -g pnpm@latest.
.^.
[FIXED]: java.io.IOException: Cannot run program "/bin/bash"
Just restart jenkins:
service jenkins restart[FIXED] ruby on rails :: LoadError: cannot load such file -- distribution
Specifically for the wco stack, gem 'iron_warbler' had to be included in that particular instance's (micros_*) Gemfile. Which is a bit disappointing since I wanted libraries to be decoupled - but hey, I'm not going to fix this right now. But please be aware: it may seem that there is a separation between libraries and some libraries (namely models and content) can be installed without the rest of the stack - but that's not the case. The whole stack must be installed.
[FIXED] prosody: usermod: UID '0' already exists
That happens because the${CONTAINER_VOLUME} path must belong to a user other than root, or prosody fails to start.
Open-source antivirus
Check it out: https://www.clamav.net/
What's a better name: tag1 or tag_1 ? Should it be tag-1 or tag_1 ?
Or the same question can be asked as: what's a better name: tag1 or tag-1? Depending on if underscores are disallowed, or dashes are disallowed.
While we are on the topic of dashes vs underscores, check out when to capitalize HTML classes, and when to keep ids in Pascal Case.
[FIXED]: An external drive not mounting on mac (fsck, not fdisk)
This happened to me recently... I may have unplugged an external 5Tb harddrive without ejecting it from mac os x 13, and it could not be mounted again. I plugged the harddrive into a windows machine, run "repair" there (whatever that means) and the data was perfectly readable. It's just that the disk would not mount on mac.
Stackoverflow to the rescue! The solution is:
sudo pkill -f fsck
Or actually
ps aux | grep fsck