mediatribe.net -- Drupal et développement web

Mediatribe.net n'accepte plus de nouveaux clients. Rendez-vous chez Koumbit.org si vous cherchez des développeurs Drupal d'expérience.

Selenium: testing Javascript with Simpletest on Drupal 7

by Albert Il y a 2 weeks 2 days

Introduction

Drupal's core Testing (machine name: simpletest) module allows you to create functional tests which can be run from within any instance of Drupal. These tests ignore the current site and install a brand new testing instance of your Drupal site on which to perform tests; this sandbox is destroyed after the tests run. To learn this by example, please see the http://drupal.org/project/examples module.

Read the full story at Koumbit

( comments, last Il y a 2 weeks 2 days)

Enabling a theme in D7 and setting it to default

by Albert Il y a 2 weeks 3 days
I normally will do this in the install hook of my site's main feature when using dCycle <?php  theme_enable(array('mytheme'));  variable_set('theme_default', 'mytheme');?> » read more
( comments, last Il y a 2 weeks 3 days)

Using prepopulate on Drupal 7's contact form

by Albert Il y a 2 weeks 3 days
Say I have several categories in my Drupal contact form, and I'd like to create a link to the contact form, but with one of those categories preselected, and, while I'm at, prepopulate the subject and message fields, here's how I go about it. (1) install and enable the prepopulate module. (2) Figure out which category (recipient) you want to preselect by finding its ID on the page example.com/... » read more
( comments, last Il y a 2 weeks 3 days)

Installing / debugging MAMP on Mac OS X

by Albert Il y a 7 weeks 1 day
MAMP is a local server with MySql and PHP on your Mac. It is great to run local copies of Drupal, Wordpress, etc. on your computer. Here's how to install it. I reinstall MAMP every time I update Mac OS X (say, from 10.6.6 to 10.6.7). The reason is that updating Mac OS X results in MySQL Server refusing to start (i.e. I get the red light next the Mamp Server), and after hours of searching, I can'... » read more
( comments, last Il y a 7 weeks 1 day)

Using Mac OS to make an iPhone 3G work like an iPod Touch

by Albert Il y a 10 weeks 1 day
Here's how I got an iPhone 3G I inherited from my sister to work like an iPod Touch. (So much for Apple's legendary ease of use -- this took me an hour to set up.) Note that I don't care about the phone, speed, features, lost data, or having the latest version. I just want to access the internet with wifi. 1. Put any SIM card in your iPhone and connect the iPhone to your Mac. 2. Download... » read more
( comments, last Il y a 10 weeks 1 day)

mysql server gone away, Drupal 6 and MAMP

by Albert Il y a 12 weeks 4 days
In my experience, the problem is always too many cck fields. Here's how to fix this: (1) open /Applications/MAMP/bin/startMysql.sh with your favorite text editor (2) put "--max_allowed_packet=16M " before the trailing & (3) restart MAMP » read more
( comments, last Il y a 12 weeks 4 days)

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

by Albert Il y a 32 weeks 2 days
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... » read more
( comments, last Il y a 32 weeks 2 days)

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

by Albert Il y a 32 weeks 3 days
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 Il y a 32 weeks 3 days)

Dev-stage-prod in Drupal: a formalized workflow

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

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

by Albert Il y a 39 weeks 3 days
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 Il y a 39 weeks 3 days)

Definitive Guide to Drupal 7 Launched!

by Albert Il y a 40 weeks 1 day
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 Il y a 40 weeks 22 hours)

Lancement du Definitive Guide to Drupal 7 !

by root Il y a 40 weeks 1 day
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 Il y a 40 weeks 22 hours)

Installing a wyiswyg editor on Drupal 6 and 7

by Albert Il y a 40 weeks 2 days
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 Il y a 39 weeks 1 day)

Drupal on a virtual host in MAMP on Mac OS X

by Albert Il y a 41 weeks 3 days
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 Il y a 41 weeks 3 days)

Adding a user to a group in Mac OS X

by root Il y a 41 weeks 3 days
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 Il y a 41 weeks 3 days)

Using hook_update_n() for non-database-related updates

by Albert Il y a 50 weeks 3 days
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 Il y a 50 weeks 2 days)

Call to undefined function image_gd_check_settings()

by root Il y a 1 year 2 weeks
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 Il y a 1 year 2 weeks)

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

by Albert Il y a 1 year 5 weeks
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 Il y a 18 weeks 3 days)

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

by Albert Il y a 1 year 5 weeks
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 Il y a 1 year 5 weeks)

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

by Albert Il y a 1 year 15 weeks
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 Il y a 18 weeks 1 day)

Finding files by name in Linux

by Albert Il y a 1 year 18 weeks
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 Il y a 1 year 18 weeks)

Using aliases to navigate the command line

by Albert Il y a 1 year 18 weeks
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 Il y a 1 year 18 weeks)

Moving WMVs from Vista to a mac for video editing.

by Albert Il y a 1 year 27 weeks
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 Il y a 1 year 16 weeks)

Sharing between Mac OS X Snow Loepard and Windows Vista

by Albert Il y a 1 year 27 weeks
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 Il y a 1 year 27 weeks)

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

by Albert Il y a 1 year 30 weeks
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 Il y a 1 year 30 weeks)

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

by Albert Il y a 1 year 32 weeks
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 Il y a 42 weeks 3 days)

A hosting platform -- the end of an experiment

by Albert Il y a 1 year 33 weeks
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 Il y a 1 year 33 weeks)

Converting a word doc to pdf

by Albert Il y a 1 year 36 weeks
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 Il y a 1 year 18 weeks)

Displaying the total number of rows in a view

by Albert Il y a 1 year 46 weeks
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 Il y a 1 year 46 weeks)

how to upgrade a module to drupal 7

by Albert Il y a 1 year 46 weeks
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 Il y a 1 year 46 weeks)

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

by Albert Il y a 1 year 48 weeks
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 Il y a 26 weeks 5 days)

Creating actions for use with views bulk operations

by Albert Il y a 2 years 2 weeks
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 Il y a 2 years 2 weeks)

Great site for checking nameservers

by Albert Il y a 2 years 8 weeks
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 Il y a 2 years 8 weeks)

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

by Albert Il y a 2 years 10 weeks
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
(4 comments, last Il y a 4 weeks 5 days)

Counting inodes (files, folders, symlinks)

by Albert Il y a 2 years 10 weeks
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 Il y a 2 years 10 weeks)

Setting up wysiwyg with image upload on Drupal

by Albert Il y a 2 years 10 weeks
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 Il y a 47 weeks 5 hours)

Un YouTube pour les mp3

by Albert Il y a 2 years 27 weeks
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 Il y a 47 weeks 6 days)

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

by Albert Il y a 2 years 28 weeks
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 Il y a 2 years 28 weeks)

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

by Albert Il y a 2 years 28 weeks
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 Il y a 2 years 28 weeks)

Setting up Cron with Drupal 6 and cPanel

by Albert Il y a 2 years 29 weeks
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 Il y a 1 year 14 weeks)

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

by Albert Il y a 2 years 30 weeks
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 Il y a 2 years 30 weeks)