Testing a Drupal 9 Module
...eventually, my versions worked. I then asked GPT to write a minimal test. We'll use that one instead of my actual tests...
...eventually, my versions worked. I then asked GPT to write a minimal test. We'll use that one instead of my actual tests...
I have the fortune and the misfortune of having to scale my Drupal site immediately. It's getting more traffic than I can currently accommodate - and so the next scaling steps have to be taken.
I have some good news and some bad news. The good news is that my website(s) are bringing in traffic, the load is spiking. No thanks to google - I am still on their terrorist list or whatever, so even when I'm directly in front of their faces they don't see me. But my sites are gaining popularity anyway.
After months of delay, I am pleased to announce the implementation of email newsletters at Wasya.Co and Piousbox.com
I have seen this error, which has prevented cron runs for over a month.
You'd have to resolve the underlying error by running the cron from drush and fixing whatever problem it reports:
./vendor/bin/drush core:cronNote that not have the base_url set is NOT a problem, you don't need to set it in Drupal 8 9 or 10, and you can run it via drush like so:
[FIXED]: Drupal 9 Error: Call to a member function transformDimensions() on null in template_preprocess_image_style() (line 263 of core/modules/image/ image.module)
...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.
Turns out, our client needs to have Client authentication enabled:
then you will have a new tab credentials where you will see the client secret.
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.