The illusion of freedom and control in our modern technology (phones, apps and social media websites)

Submitted by charles on

The makers of the many of the apps and probably all of the social media websites we use (Facebook, Twitter, Gmail, LinkedIn, YouTube) don't have our best interests at heart, and are designed to keep us within their environments for as long as they can, and to make sure we come back often. This shouldn't come as a surprise, when most of the business models are advertising based, and more time spent = more advertising revenue potential.

Cache-Control: max-age header missing from static files in Drupal

Submitted by charles on

One of the sites I maintain recently had a server upgrade to Ubuntu 14.04.4, which included a new version of varnish (version 3.05) which required an update to the Varnish configuration. After setting up a new default.vcl file I was monitoring the headers sent and received to make sure that what was supposed to be cached was in fact being cached by Varnish. While testing I discovered that I was not getting any Cache-Control headers from static files like images.

The Tesla website uses Drupal

Tesla, Elon Musk's electric car and energy storage company is built using Drupal. The home page features an attractive and engaging, fully responsive HTML5 video, with two simple call to action buttons overlaid on top of the video. On smaller screens the video is replaced by static images of the cars. I also noticed that the site uses panels, and the Shopify platform for it's e-commerce shop.

South African born Musk's Tesla and SpaceX websites use Drupal

Submitted by charles on

I'm a huge fan of Elon Musk, the world-changing, South African born pioneer of the consumer electric car and space technology company SpaceX, and was pleased to learn that both the Tesla website, and the SpaceX website are built on Drupal. Both are currently Drupal 7 sites with home pages that use beautiful images and videos (in the case of the Tesla site) to provide high visual impact and engagement.

Tesla website uses Drupal
Tesla's visually compelling Drupal website home page

Identifying and fixing mod_evasive "client denied by server configuration" errors

Submitted by charles on

I recently migrated a Drupal 6 site to Drupal 7 using the migrate and migrate_d2d modules. While testing the new site on my client’s server, every now and again ajax requests were failing, and page resources like images were not loading. The apache error log showed a number of “client denied by server configuration” errors. 

Apache mod_evasive client denied by server configuration errors

CCK form field changes using Drupal's hook_form_alter don't work? Use #after_build

Submitted by charles on

I ran into issues when trying to use drupal's hook_form_alter to change some attributes of cck fields in a node form. It appears that depending on the weight of the module the form_alter is in, it might get called before the actual form element has been processed.

To make sure, you can set a function to be called after the form has been properly created, but before rendering.

In your form alter, add the after build key to the form field's array:

$form['field_course_status']['#after_build'][] = 'course_disable_status_field';