Blogs

Using Drupal 6 to collect history on nodes

This is pretty simple, but maybe not completely obvious as the default settings in Drupal 6 are turned off.

So basically you just turn on create revision on save (check the box on the content type you want to collect history for)
Administer > Content management > Workflow settings > Create new revision

Now if you save a change to an existing node look at the database table you will notice that a new record is created with a VID (Version ID) reference in the content type table.

Zipping files in Ubuntu is easy just use tar

To create a tar with Gzip compression (recursive by default):
tar czf zip_of_relative_path_recursive.tar.gz relative/path

To extract files from tar using Gzip to the current directory:
tar xzf relative/path/to/zip_of_relative_path_recursive.tar.gz

References:
http://ubuntuforums.org/showpost.php?p=5798678&postcount=7

Drupal Drush

Sounds like a bad disease, but it's the best thing about Drupal. It's the main reason I'm still persisting with this unwieldy product. With features like command line backup and restore of all files and database, automatic update of modules, password reset and other user management functions, sql database functions, content type manipulation, and lots more, it is the only thing that keeps me sane dealing with the enormous code base.

Dell XPS L702x Ubuntu 11.04

[Solved!]
Ok, I think I've got it! I'd never used the Ubuntu Display Settings tool before, but it seems to work pretty well, and it even supports multi-monitor! Load it at System->Preferences->Monitors. If you have your display port cable plugged in then it should just detect all your monitors and you can set them up with individual resolutions, etc. Oh man, the number of hours I've spent on this and of course it is actually so easy.

Note that when you set your monitor input source to Display Port it seems to take about 10 seconds to actually switch, so be patient at that step.

Drupal 7 entities

I've just spent the good part of the day trying to get my head around how the database in Drupal 7 works, I think I'm close, and here are some notes from my travels.

This is a good starting point to jump right into an example:
http://www.commerceguys.com/resources/articles/183
http://drupal.org/node/916776#comment-4344024

I'd recommend this high level article as worth a read for those trying to get a grasp on the new Drupal 7 way of doing things at a DB level.
http://www.istos.it/blog/drupal/drupal-entities-part-1-moving-beyond-nodes

Upgrading firmware in Polycom Soundpoint IP 320

The phone came with 3.0.1.0032 firmware and I remember having a tough time setting up the phone when I first got it, I think it was something to do with only being able to change one setting at a time, but then today (2 years later) it stopped working and all the settings disappeared and I could not get it going again. Basically the settings would not save in on the phone web server, even one at a time.

Dropbox Command Line Ubuntu Install

So there is a little bit to this, here are some notes that should be pretty easy to follow.

Get the platform type

$ uname -a

Install Dropbox

Log in to your Linux server so you obtain a shell prompt, and change to your home directory.

$ cd

Install EITHER the 32 OR 64 bit version.

Stable 32-bit:

$ wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86"

Stable 64-bit:
$ wget -O dropbox.tar.gz "http://www.dropbox.com/download/?plat=lnx.x86_64"

Querying a ODBC Linked Server from MSSQL

When trying to browse a linked server in MSSQL through Microsoft SQL Server Management Studio I got an error from the GUI "[LinkedServerName]...[TableName] contains no columns that can be selected or the current user does not have permissions on that object."

What tha? I confirmed that the user had access through checking the properties on the connection. So what else?

I tried querying it from the Query Editor directly...

select * from [LinkedServerName]...[TableName]

Drupal print module footer for TCPDF

Well I spent way too long on this, but I couldn't for the life of me figure out how to add page numbers to the pdf! Something that would seem so simple. Anyway, in the end this is how I achieved it, I'm sure this is not the preferred way but after hours of searching google, trawling though the issues queue for the print module at Drupal.org and not finding an answer I did this.

Commented out the overloaded function Footer() in /sites/all/modules/print/print_pdf/print_pdf.class.inc.

So then it uses the default function in /sites/all/libraries/tcpdf/tcpdf.php

Duplicate entry INSERT INTO og_access_post

The reason for this is explained in detail here:
http://drupal.org/node/309974#comment-2594564
user warning: Duplicate entry ... for key 'PRIMARY' query: INSERT INTO og_access_post (nid, og_public) VALUES (..., 0) in ... common.inc on line 3528.

Here's the short version: This happened to me because og_access has a weight of 1, and workflow has a weight of 0. Workflow's save post action triggers a node_save() inside a node_save() which confuses the hell out of OG Access and causes it to insert the record twice. Increasing workflow's weight to 1 in the system table solves the issue.