Montagu Homes
Lawyers for Human Rights
Drupal based content management system allowing the maintaining and growing of project related resources, including cases, judgements, policies and publications. Site developed for Lawyers for Human Rights NGO (non governmental organisation), South Africa. Lawyers for Human Rights is an independent human rights organisation with a thirty-year track record of human rights activism and public interest litigation in South Africa. LHR provides free legal services to poor and indigent people from six law clinics around the country.
Cooperative and Policy Alternative Center (COPAC)
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();
Drush 12 removes the "--no-post-updates" option from the drush updb command
Drush 12 no longer uses the "--no-post-updates
" option in the drush updb
command. This means that you won't be able to run database updates from drush without triggering the post update hooks.