ComMark

Converted existing website to Drupal and added new functionality. Project involved providing wireframes of the entire new site, creation of new content types and associated templates, conversion of design into a drupal theme, creation of multiple views to display the content, a small workflow component for processing and tracking of funding applications, and providing training to the client in the management of the content.

Montagu Homes

Conversion of existing static website for Montagu Properties to a Drupal content management system (CMS). The new site allows them to add new property developments (including all associated materials such as architect site plans, layouts, property photos), news and to maintain other static website content. Strategy includes the improvement of search engine result placement. Montagu Property Group offers diversified services to clients, investors and professionals in the property industry.

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)

Drupal based content management system for NGO (non governmental organisation) allowing for the adding of news, events, publications and links by the site administrator. Automatic resizing of images is performed, and all content automatically appears in the correct place on the website. The vision of this website is to promote the cooperative idea, worker cooperative movement building and cooperative sector development in South African society and on the African continent.

Using filter_var for boolean environment variables

Submitted by charles on

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

Submitted by charles on

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

Submitted by charles on

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();