mediatribe.net -- Drupal and Web Development

Mediatribe.net is no longer accepting new clients. Please visit Koumbit.org if you're looking for experienced Drupal developers.

For Drupal/dcycle theme developers: pulling new changes to a site

by Albert 16 weeks 2 days ago

If you are theming a Drupal 7 site using the dCycle workflow, and a colleague has updated features (for example, added a new view, content type, etc.), here's how to theme it:

  • In terminal, navigate to your sites/*/modules folder for your site: for example cd /path/to/your/drupal/site/sites/mediatribe.net/modules
  • Check git status. If your directory is not clean, commit your latest changes, for example
    git add .
    git commit -a -m 'my latest changes'
  • Pull changes from the remote server: git pull origin master
  • Rune the update script: drush updatedb
  • Go to your local development site and update your feature(s): admin/structure/features, then click on needs review or "overridden". Check all checkboxes and save. Repeat this step if necessary (it may keep saying overridden even after several attempts, but it may still work).
  • If a new content type has been created, you may want to use devel_generate to create dummy content for theming purposes.
( comments, last 16 weeks 2 days ago)

Drupal 7 Simpletest: in your tests, creating users with specifc roles

by Albert 16 weeks 3 days ago
When creating automated tests in Drupal 7, you can use $this->drupalCreateUser() to create a user with specific permissions, but what if you want to create a user with a specific role? Here's how to set up a user with the role "administrator", for example within your setUp() method: <?php    // create a new user with some permissions you need; then log in.    $... » read more
(1 comments, last 16 weeks 3 days ago)

Dev-stage-prod in Drupal: a formalized workflow

by Albert 19 weeks 5 days ago
Tired of dealing with many disparate dev-stage-prod workflows, I have gathered all my best practices into dCycle. » read more
( comments, last 19 weeks 5 days ago)

Drupal 6: Two menu items pointing to the same page with features

by Albert 23 weeks 4 days ago
The Drupal features module does not, for the moment, allow you to export two menu items with the same path. This is a problem if you have a menu structure like this, which is quite common: Resources: path "resources/one" One: path "resources/one" Two: path "resources/two" Now, we don't want to have a Resources page. Rather, we would like the top "resources" menu item to lead to "reasources/... » read more
( comments, last 23 weeks 4 days ago)

Definitive Guide to Drupal 7 Launched!

by Albert 24 weeks 2 days ago
The Definitive Guide to Drupal 7 has finally been launched. At over 1100 pages, this book contains all necessary information to use Drupal 7 to its full potential. Thirty authors contributed included Koumbit's own Albert Albala with a chapter on automated testing. » read more
(4 comments, last 24 weeks 1 day ago)

Lancement du Definitive Guide to Drupal 7 !

by root 24 weeks 2 days ago
Le Definitive Guide to Drupal 7, a finalement été lancé. Avec plus de 1100, ce livre contient toute l'information nécessaire pour bien utiliser Drupal 7. Trente auteurs ont collaboré à ce livre, dont le koumbitien Albert Albala avec un chapitre sur les tests automatisés. » read more
(2 comments, last 24 weeks 1 day ago)

Installing a wyiswyg editor on Drupal 6 and 7

by Albert 24 weeks 2 days ago
Installing a wysiwyg editor is a convoluted process with numerous obstacles. Here is my step-by-step procedure for Drupal 6 and for Drupal 7. » read more
(2 comments, last 23 weeks 2 days ago)

Drupal on a virtual host in MAMP on Mac OS X

by Albert 25 weeks 4 days ago
When you install MAMP, localhost points to your htdocs folder. I install multiple sites in there, so that localhost/example, for example, is a Drupal site. The thing is, certain irritating things happen when Drupal is running in a subdirectory, so I would rather have my Drupal sites run on, for example, example.local. Here's how that's done: == Before you start == Make a backup of your /etc/... » read more
( comments, last 25 weeks 4 days ago)

Adding a user to a group in Mac OS X

by root 25 weeks 4 days ago
Here is how to add your user, say, albert, to the group wheel in Mac OS X Snow Leopard: sudo dscl . append /Groups/admin GroupMembership albert » read more
( comments, last 25 weeks 4 days ago)

Using hook_update_n() for non-database-related updates

by Albert 34 weeks 3 days ago
Note that this article applies primarily to Drupal 6. When developing features or other modules, I often find myself making changes to the module dependencies or other aspects after my module has first been moved to the staging site. I use hook_update_N() for that. Here's how. Initial install hook Features normally don't do anything to the database, so typically we wont have an implementation of... » read more
(2 comments, last 34 weeks 2 days ago)

Call to undefined function image_gd_check_settings()

by root 38 weeks 1 day ago
Getting Fatal error: Call to undefined function image_gd_check_settings() in ... This was after I migrated a Drupal site to Aegir. The solution is to visit this page: admin/settings/image-toolkit and click save. See also http://drupal.org/node/295854 » read more
( comments, last 38 weeks 1 day ago)

Theme-specific image styles (equivelent of imagecache) in Drupal 7

by Albert 41 weeks 2 days ago
Image styles in Drupal 7 are the equivalent of Imagecache presets in Drupal 6: definitions of a namespace with one or more effects for images. For example, a "thumbnail" image might be 150 pixel-wide version of your image. These image styles are then used in views, displayed nodes, etc. The problem is: what a "thumbnail" is for one theme might differ from what it is for another theme. Say you are... » read more
(5 comments, last 2 weeks 3 days ago)

Styles d'images (equivalent de imagecache) spécifiques au thème dans Drupal 7

by Albert 41 weeks 2 days ago
Les styles d'image (image styles) sont à Drupal 7 ce que les préréglages imagecache sont à Drupal 6: une définition de comment une image doit apparaître. Par exemple, une "vignette" (thumbnail) pourrait être une image de 150 pixels de large. Ces préréglages peuvent ensuite être utilisés par les vues, les nodes, etc. Cepedant, différents thèmes peuvent avoir différentes conceptions de ce qu'est... » read more
( comments, last 41 weeks 2 days ago)

Building a javascript-based browser map with views for Drupal 6

by Albert 51 weeks 3 days ago
Recently for a projet I needed to build a javascript-based browsing mechanism for alternatives.ca. You can see the result at http://alternatives.ca/projets. I'll try to describe how this was done. It takes about two hours to set this up properly. Compatibility: IE7 and above. The basic idea I categorized my content with taxonomy, then created a view with exposed filters, enabled ajax in the view... » read more
(4 comments, last 2 weeks 2 days ago)

Finding files by name in Linux

by Albert 1 year 2 weeks ago
One way of searching for a file containing "abc" through a file system without annoying "Permission denied" messages: find . -name '*abc*' 2>/dev/null » read more
( comments, last 1 year 2 weeks ago)

Using aliases to navigate the command line

by Albert 1 year 2 weeks ago
I need to have access to several ssh servers, and several paths throughout my working day. I'm a very unsophisticated command line user, so for others out there who would like to tame the command line, here's a trick: vi ~/.bash_profile Add, at the very end alias go-whatever='cd /path/to/whatever'alias go-client='ssh me@client.com'#etc. Then, to make aliases permanent source... » read more
( comments, last 1 year 2 weeks ago)

Moving WMVs from Vista to a mac for video editing.

by Albert 1 year 11 weeks ago
I have a FireWire camcorder, a Vista machine with FireWire; and Mac OS X 10.6 machine sans FireWire with Final Cut Express video editing software. This technique takes about 10 hours of processing and transfer time for each hour of footage Here's how I go about transferring my movies for editing: (1) Download wmv2avi.exe http://www.freewarezoom.com/archives/free-wmv-to-avi-mpeg-converter to... » read more
(1 comments, last 1 year 3 days ago)

Sharing between Mac OS X Snow Loepard and Windows Vista

by Albert 1 year 11 weeks ago
Found a great resource which will have this set up in a few minutes. Just deactivate your Vista firewall before sharing and reactivate it after. http://www.youtube.com/v/w4chH8hrs6A?fs=1&hl=en_US » read more
( comments, last 1 year 11 weeks ago)

Installing Gobby 0.5 on Mac OS (via Ubuntu on VirtualBox)

by Albert 1 year 14 weeks ago
Gobby is a tool which allows teams to edit the same document simultaneously in real time. We use it at Koumbit during some meetings; and when we quickly need to produce a document without going through the normal revision procedures. As of this writing Gobby 0.5 is not available directly on mac OS X (The MacPorts installation guide here gives me Gobby 0.4, which is incompatible with Gobby 0.5).... » read more
( comments, last 1 year 14 weeks ago)

How to scan with the lexmark X5495 on Mac OS X 10.6.8

by Albert 1 year 16 weeks ago
Update: 9 Oct 2011. Made some slight changes, still works though. I've just spent an hour on the phone with Lexmark because my mom wanted me to scan something on my Lexmark X5495 scanner. This is the second time in two month that I have to call Lexmark in order to get my scanner to work. I'm documenting the solution here -- it worked for me. These steps assume you have already set up your printer... » read more
(1 comments, last 26 weeks 4 days ago)

A hosting platform -- the end of an experiment

by Albert 1 year 17 weeks ago
Aegir, Drupal—Last year we launched a beta version of Qumbia, a platform for creating Drupal sites easily. Today we are definitely shutting it down. I'll attempt to explain how it worked, why we're shutting it down, and what will replace it. Here's how it worked: one "master" site, with all the basic functionalities you'd want in a basic website (wysiwyg editing, captcha, blog, events, store etc.) was kept up... » read more
( comments, last 1 year 17 weeks ago)

Converting a word doc to pdf

by Albert 1 year 20 weeks ago
I recently got a 2Mb word document I had to convert to PDF to put online. For some reason, on Mac OS X: OpenOffice (through the print... dialog) generated a 64Mb document Acrobat (through extreme space saving meaures) generated a 24Mb document OpenOffice (through export... > Adobe PDF > smallest file size) generated a whopping 160Mb document Google Docs couldn't read by word doc at all (it... » read more
(2 comments, last 1 year 2 weeks ago)

Displaying the total number of rows in a view

by Albert 1 year 30 weeks ago
Drupal—Put a pager, make sure your items to display is not set to unlimited, and put this in your header or footer: <?php $view = views_get_current_view();print $view->total_rows . ' ' . t('items in this category'); ?> » read more
( comments, last 1 year 30 weeks ago)

how to upgrade a module to drupal 7

by Albert 1 year 30 weeks ago
drupal development—Here are some step-by-step instructions on how I upgrade modules from d6 to d7: drush dl coder drush dl grammar_parser drush en coder_upgrade put the latest 6.x version of the module into sites/mediatribe.net/files/coder_upgrade/old go to admin/config/development/coder/upgrade click the checkbox next to the name of the module you are upgrading to d7 click convert files make sure there are no... » read more
( comments, last 1 year 30 weeks ago)

Adding content (text and images) to a Drupal site via email

by Albert 1 year 33 weeks ago
Drupal—In my experience, there are several users who don't feel comfortable using the standard Drupal interface to create content on their website. I've noticed that this is the case with reforestation.net, I site I manage: even though I provide users with accounts and training, almost all users end up sending me their content (including images and text) via email, and I have to upload it myself to the... » read more
(2 comments, last 10 weeks 6 days ago)

Creating actions for use with views bulk operations

by Albert 1 year 38 weeks ago
Drupal—You can combine Views bulk operations with your own code to make powerful actions which can be applied to several nodes at the time. Here is some sample code to create an action:   /* describe your action(s) */function mymodule_action_info() {  return array(    'mymodule_action_callback' => array(       'type' =>... » read more
( comments, last 1 year 38 weeks ago)

Great site for checking nameservers

by Albert 1 year 44 weeks ago
Jus enter any domain here: http://intodns.com/example.com And it will give you info about your nameservers. Here are some practical commands for use with mac os x: dscacheutil -flushcachetraceroutenslookup » read more
( comments, last 1 year 44 weeks ago)

Displaying a block with a field from the current node using Views 2 and Drupal 6

by Albert 1 year 46 weeks ago
Drupal, Views—I have a CCK field with an image on my page nodes. I want to display a block with the CCK field value on its related node, but nothing on non-pages. This often works in the views preview, but not on the actual page. This was driving me nuts and I spent a few hours finding this solution: Create view with Filter: node nid > 0 Argument: node nid, Action to take if argument is not present:... » read more
(3 comments, last 7 weeks 3 days ago)

Counting inodes (files, folders, symlinks)

by Albert 1 year 46 weeks ago
Many hosts restrict the number of inodes you can use on a VPS or shared account. If you have shell access, the following commands are useful to determine how many inodes you are using: ls -R /path/to/directory | /usr/bin/wc cd /path/to/directoryfor i in $(ls);do echo -n "`pwd`/$i: ";find $i -print|wc -l 2>/dev/null;done » read more
( comments, last 1 year 46 weeks ago)

Setting up wysiwyg with image upload on Drupal

by Albert 1 year 47 weeks ago
Drupal—Update May 3, 2010 -- Please see the first comment, below. Some of the hacks in this article are outdated. Please proceed carefully and report your results here! Warning: this will take you at least an hour and if you make even the slightest mistake, it won't work! Please try this on a test site to make sure it suits your needs! Related issues: Doesn't work with themes with dark backgrounds:... » read more
(3 comments, last 31 weeks 15 hours ago)

Un YouTube pour les mp3

by Albert 2 years 11 weeks ago
Pour ceux qui cherchent un service de type YouTube pour les fichiers sonores (mp3, etc.), j'ai trouvé HoundBite qui fonctionne très bien... si le logo de la société sur votre site ne vous gêne pas! Seul hic: en téléversant un mp3, mon fureteur m'a averti qu'un script sur le site demandait l'accès sans restriction à mon ordinateur... ce que j'ai refusé, bien sûr, mais tout a fonctionné quand même. » read more
(2 comments, last 31 weeks 6 days ago)

Bloc de sélecteur de langue dans Drupal: Ne pas afficher la langue active

by Albert 2 years 12 weeks ago
Drupal, multilingue—La plupart de nos clients ont un site bilingue (français et anglais). Le bloc "sélecteur de langue" (Language Switcher) est une bonne façon de passer d'une langue à l'autre, mais souvent nous ne voulons pas afficher la langue courante. Par exemple, sur une page en français, nous voulons un lien vers le contenu en anglais, mais pas de lien "français". Notre solution est d'ajouter le css suivant à... » read more
( comments, last 2 years 12 weeks ago)

Using diff and patch for directories, and managing patches during Drupal upgrades.

by Albert 2 years 12 weeks ago
Drupal—Background: I was recently making a Drupal site where I needed (as is often the case) a visual text editor along with image- and file-upload capabilities. I tried using the wysiwyg module in conjunction FCKEditor 2.6.x, which is a good combination for that purpose. Since this does not work out of the box, I followed the instructions here. This procedure requires modifying files in the Wysiwyg... » read more
( comments, last 2 years 12 weeks ago)

Setting up Cron with Drupal 6 and cPanel

by Albert 2 years 14 weeks ago
cPanel, Drupal, procedures—If you have a drupal site on a cPanel account, you can set up cron in cPanel. Here is how: (1) Your site is, say, example.com (2) Log into cPanel (example.com/cpanel) (3) Go to cron jobs > standard (4) Enter the following code in your cron: /usr/bin/lynx -source http://example.com/cron.php (replace example.com with your actual website) I normally choose every hour, every day, every weekday,... » read more
(2 comments, last 50 weeks 3 days ago)

Language Switcher Block: Not displaying the active language in Drupal 6

by Albert 2 years 14 weeks ago
Drupal, Multilingual—Most of our clients have bilingual (French and English) websites. The Language Switcher Block is a great way to switch between languages, but we often don't want to display the active language. For example, on a French-language page, we want to have a link to English (not French and English). Our solution is to add the following css either to your theme, or, if you are using a contrib or core... » read more
( comments, last 2 years 14 weeks ago)