I'm a backend Drupal engineer with 20 years of experience. I'm currently contracted via Tag1 Consulting, working on a Drupal 11 and PHP 8+ system for a confidential Top 10 Global 500 company. I maintain Entity Inspector, a developer tool for inspecting raw entity data as JSON, and I'm a founding member of the Drupal Johannesburg User Group. This site is my home on the web, a place for my blog, my open-source work, and writing about backend engineering and where AI tools genuinely help in a developer's workflow.
Charles Tanton - backend Drupal engineer, based in Kommetjie
Most recent work
Tag1 Consulting Drupal 10 & Drupal 11 backend work
Since July 2019, I've been contracted by Tag1 Consulting, and am currently working as part of a team doing Drupal 10 & Drupal 11 frontend and backend work for one of their clients, a US based, Fortune 10 tech company (I'm not allowed to say who). We've been prototyping a number of potential new sites, and helping some of their in-house teams maintain and add features to existing sites.
Read more...The Internet Advertising Bureau (IAB) UK Drupal 7 to Drupal 8 Migration
I was contracted by LAB to manage the migration of content from the old IAB website (Drupal 7) to an under construction, Drupal 8, IAB UK website. I successfully set up and ran migrations for 16 Drupal 7 content types (including some with field collections), to some fairly complex, paragraph based, new Drupal 8 content types. This included document and image migration, as well as taxonomy migration. Some custom migration plugins had to be created to convert data from the old site into the correct format that the new site required.
Read more...Most recent blog posts
Developer news sources aggregated
Just came across a phenomenal resource of aggregated dev focused news. Check it out at https://devurls.com/.
You're welcome :-)
CKEditor5 plugin shim to support deprecated Model in CKEditor 41.3.1
Drupal 10.3 uses CKEditor 41.3.1, which changed Model to ViewModel.
To support both Drupal 10.2 and 10.3, you can use this shim.
Make sure you have this in global.d.ts:
Using filter_var for boolean environment variables
Someone on my team added the following setting to check whether an environment variable was true or false:$settings['x_menu_admin_enable'] = strtolower(getenv('X_MENU_ADMIN_ENABLE')) === 'true' ? getenv('X_MENU_ADMIN_ENABLE') : FALSE;
I find that using PHPs filter_var makes this code a bit easier to parse and only calls getenv once:
Custom validation on a views field plugin options form
When validating an options form for a views field plugin class that extends FieldPluginBase, you need to add a `validateOptionsForm()` function and use an array for getting the value although when setting the error you don't need to include 'options':/** * {@inheritdoc} */public function validateOptionsForm(&$form, FormStateInterface $form_state): void {
Get the full message from your Guzzle Response exception object
I was trying to debug a Guzzle response error but the error message was fairly long and some crucial information about which specific API fields were unauthorized was missing. The Guzzle Client Exception object has some handy methods to allow reading the full message contents:
$exception->getResponse()->getBody()->getContents();