Creating components with Drupal

When you make a few Drupal sites, you will eventually find that you want to be able to take a feature that you created on one site and move it across to another site. After all, why re-invent the wheel!

My procedure for doing this has changed over time, using the features module was the way with Drupal 6 and Drupal 7, but with Drupal 8, we have better configuration management, and modules to help make things easier.

Features is again one of the modules that can be used, but I prefer a lighter approach, though its perhaps a little more work.

Simon Lindsay Mon, 01/25/2021 - 08:31
Furious fortnight

Covid means some extra time away from my day job at the University of Adelaide. This means I have a fortnight of time to work on side projects as if they were my full time gig. This is a great opportunity to knock some things out, so this is the plan.

Simon Lindsay Tue, 01/05/2021 - 14:09
Wondering if you got all instances of SA-CORE-2014-005 patched?

Assuming you have locate installed/setup:

locate database.inc | grep "database/database.inc" | xargs grep "\$data "

Will output any copies of database.inc that are not patched.

Simon Lindsay Fri, 10/17/2014 - 08:54
DOMDocument, DOMXPath and invalid html
I've been doing some work with DOMDocument and DOMXPath to parse webpages recently, and even though I could get the XPath directly from Firefox or Chrome, it would not match in the $xpath->query(); What I found is that the $dom->LoadHTML($page); will handle invalid HTML, but mostly just by stripping it out. This is fine, unless you depend on the structure for the XPath query. The problem was the the page contained tables (we've all built them, missing the TBODY tags).
Simon Lindsay Sat, 05/10/2014 - 09:13
Run drush as a specific user?

Some contrib modules have drush commands, you may need to specify a user on the command line to get the correct permissions. Older versions of node_export module had this issue, and the drush command needed is:

drush --user=1 node-export
Simon Lindsay Mon, 07/01/2013 - 13:24
Speed up loading Drupal database into mysql

I've developed a little script over the years that dumps production databases, and loads them locally on demand, and its been very handy.

However, it was taking ages to load a database on a Virtualbox ubuntu environment I use for debugging with Zend.

A quick look into it, and I found that i'd put

--skip-extended-insert
on the mysqldump command sometime in the past.

I changed that to

Simon Lindsay Wed, 06/29/2011 - 09:30
10+ years of Drupal

Drats, I missed my drupal.org 10th birthday!

http://drupal.org/user/143

I was actually using Drupal before drupal.org existed, and my http://dirtbike.ws website - currently re-branding as http://mydirtbike.com - would be amongst the longest running Drupal based sites there is.

I've seen Drupal go through fantastic growth through the years, and the future looks brighter every day, with new Drupal companies appearing, new conferences, camps and meet-ups, the Drupal ecosystem looks to be very healthy.

Keep up the good work Dries & co.

Simon Lindsay Fri, 04/01/2011 - 08:41

New CCK module to accept signatures on *Pad devices

With all the new *Pad style devices coming out now, I wanted to be able to get signoff by customers on the spot using a signature for quotes, jobs etc in our drupal based ERP system.

This module facilitates that by allowing creation of a CCK field which accepts input via mouse, finger, stylus or anything that can draw on the screen.

You can grab the cck module here:

http://drupal.org/project/signhere

or try it out for yourself here:

http://singularo.com/node/add/sign-here

Getting twitter<->drupal integration going again

With luck, this will get twitter posts working again from my Drupal site. If your twitter module has stopped working, this guide helped me get it going again.

http://fatedtoend.com/content/how-get-drupal-post-updates-twitter-again-or-how-fix-twitter-module-drupal

Simon Lindsay Thu, 11/04/2010 - 16:35