Drupal – Leveraging built in string functions in custom modules
Drupal includes native versions of a few common php string functions; strlen() for example is called with drupal_strlen(). drupal_strlen counts the amount of characters in a UTF-8 string vs. counting...
View ArticleDrupal – adding debug messages to your custom module
I work with a few custom modules and lately I’ve been migrating one from PHP 5.2 to 5.3 & Webform 2 to 3. It’s been a challenge to sort out where some of the the errors are being generated from so...
View ArticleDrupal – adding debug messages to your custom module – Improved
As a follow up to ‘Drupal – adding debug messages to your custom module‘. I improved the code and wanted to share. Now you can drop in a few functions and add one line to your hook_admin_settings...
View ArticleVid’s sliding-scale of sleep
Several years ago, a child was born, well statistically speaking quite a lot of them were, but around the time one child in particular was born I was getting little sleep. Out of this experience a...
View ArticleReset a password on a Parallels VM
I forgot the password to a RedHat 6 Parallels VM recently. It’s a VM that we use to test changes to Aegir prior to working on the live hub. Max Bronsema created and shared this VM a few years ago....
View ArticleAn improved PS1 for Git in Bash
Last year I updated my bash prompt (PS1) to include the active git branch name. A few months ago I added to the the active repository name. So here’s an example of my PS1 when I’m in a git tracked...
View ArticleBash – Add drupal site name to PS1
I updated my bash prompt (PS1) the other day. Now it displays what site I’m in. I recently posted my former change: An improved PS1 for Git in Bash. Now I added an extra bit of code that inserts the...
View ArticleDrupal 7 – list taxonomy terms
I’m running some tests and thought I’d post the php code to display the terms for a taxonomy: At the moment I’m considering leveraging the benefits of CCK Select Other for ease of entry with taxonomies...
View ArticleDrupal 7 Views – Manipulating Args with php
I wanted to pass a string to a view that only accepts an entity id as an argument. I the past I’d been able to use a string based argument after adding relationships but that wasn’t possible in this...
View ArticleDrupal 6 – Pre-Popluate Menu Parents with jQuery
Here’s a fun one. I wanted the menu parent to be pre-populated on node creation. Use case: When a content editor creates a new ‘Electronic Flyer’ it will be added to the per-determined menu: Primary...
View ArticleDrupal 7 – resizing the content area based on publish date
I was asked to look at a site where the content created before Jan. 15th 2013 was crafted to display nicely in a 600px wide area. New content is being added with a much wider area and with some thought...
View ArticleRe-wrap a modified JS function
The question came up recently about the possibility of modifying an existing javascript without duplicating it. Yesterday, I found out that it’s indeed possible. The key to the solutions is to re-wrap...
View ArticleClean up your curl – fixing relative links in scraped content
A few years ago I Added jQuery browser check for ODT and Skillport eLearning. This week I updated that functionality and noticed a relative link in some remote content I was scraping via cURL. The...
View Articlegit branch – auto setup rebase = always
I was revisiting Randy Fay’s Rebase Workflow post and went down the ‘rebase’ rabbit hole again. Each time I learn a little more. Probably because I understand a little more… This time I landed here:...
View ArticleWorking on a file in two git branches at one time
I have a file in two different branches of a project that is so drastically different (hundreds upon hundreds of changes) that merging was becoming unreasonable. I’ll call that file CONVOLUTED.module....
View ArticleReponsive design and the iPad viewport
I had been noticing that the iPad’s viewport in webkit browsers was odd but I couldn’t put my finger on it. So I opened Safari on the iPad and ran some JS in firebug lite; the result: 768×504 in...
View ArticleDrupal 6 – Contact Override custom module
Just created a quick and dirty custom module: Contact Override. I posted it on bitbucket: bitbucket.org/_vid/contact_override Nothing too exciting, just an override to the D6 contact form. It appends...
View ArticleDrush enable all inactive modules
I’ve been using make files a lot lately and when ever I’m ready to release an updated file I like to verify that all the project versions are up to date. To leverage Drupal’s update functionality each...
View ArticleConcatenate fields in a Fillable form
Recently someone referenced an old blog post: use data from one field to populate other fields in an acrobat fill-in forms and asked me how to concatenate multiple field values into one. So I put...
View ArticleUpdating select lists in bulk – w/ jquery, drupal
So I wrote this script 1 year and 1/2 ago about bulk label operations (Drupal 7 CCK – Creating ‘Label Bulk Operations’). Well the updateLabels() function from that code came in handy today. I needed to...
View Article