Drupal.

A first functional test in Drupal 9 (test a redirect in a controller)

...of course this took longer than anticipated, but I have achieved this milestone, writing and executing a complete functional test in Drupal. It was not an easy, trivial test - and the path I took in implementing it highlights the gotchas and difficulty of writing such tests. As well, my process is likely not be unique, and the challenges I faced appear common. It there appears valuable for me to put down a quick writeup on quirks and tricks I saw along the way. In this article, I assume the reader is an intermediate Drupal developer.

[FIXED]: Error: Call to a member function transformDimensions() on null in core/modules/ image/image.module

The issue stems from the preview being in an undefined style.

1. Go to configuration -> image styles and review the styles available. I have a style called "200x200 thumb".

2. After adding an image field to a content type, go to manage form display, expand the display of the image, and specify an existing style from step 1 as the preview style.

After taking these steps, the page for adding/editing this content type should render correctly.

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 gz