mediatribe.net -- Drupal and Web Development

Mozy credit card change annoyance

by Albert 12 weeks 6 days ago

My credit card having been changed, Mozy contacted me to change the card on file, which I did. A few days later I get an "account suspended" message, so I changed it again. Now the home screen is giving me two contradictory messages, as you can see in the enclosed screenshot.

Contacting customer support yields yet more annoyances: opening a support ticket, it is impossible to add file attachments. And it seems impossible to track the ticket by email: the email sent to me is from "MISSING my@email.address", and contains the text:

When replying please ensure that: Your subject line includes the [ref] number, you respond from the same email address to avoid rejection, and only issues related to this case are sent to our Support Team"

Yet the reply-to address is... my own address.

(3 comments, last 9 hours 31 min ago)

Drupal 7: Absolute path to file URI or file object

by Albert 13 weeks 10 hours ago
Say you have a file in one of your modules for which you need a file object, the trick is to _copy_ it to the public filesystem, and then use it. For example, say we need to import the french translation of MYMODULE during an update, we can use the following code: <?php$file = file_save_data(file_get_contents(realpath(drupal_get_path('module', 'MYMODULE') . '/translations/fr.po')), 'public://... » read more
( comments, last 13 weeks 10 hours ago)

In PHP, getting the calling function

by Albert 15 weeks 5 days ago
In PHP, if you want to know the function that called whatever function you are currently in, you can define something like: <?php/** * Returns the calling function through a backtrace */function get_calling_function() {  // a funciton x has called a function y which called this  // see <a href="http://stackoverflow.com/questions/190421/caller-function-in-php-5" title="http://... » read more
( comments, last 15 weeks 5 days ago)

Where is the JDK directory on Mac OS X

by Albert 16 weeks 6 days ago
If you are installing Jenkins on Mac OS X, JDK is already installing (trying to install it automatically won't work). Its home directory is "/Library/Java/Home". » read more
( comments, last 16 weeks 6 days ago)

Comment gérer vos chemins sur un site Drupal

by Albert 28 weeks 2 days ago
À penser: - Quels chemins on veut pour différents contenus - Que se passe-t-il si un visiteur retire une partie d'un chemin (par exemple, il tombe sur k.o/nouvelles/2010/08/02/x-y-z, et il efface tout après 08, y a-t-il une vue ou page à prévoir ou le visiteur tombe-t-il sur une "page non trouvée") - Liens permanents (genre k.o/nouvelles/2010/08/02/x-y-z) vs. temporaires (k.o/yxz) -- dans ce cas... » read more
( comments, last 28 weeks 2 days ago)

Finding a script on Mac OS X

by Albert 39 weeks 2 days ago
To find a script on Mac OS X - which xyz will find the actual location of the script which would run. - whereis xyz will find the standard location See also this post. » read more
( comments, last 39 weeks 2 days ago)

Automatic testing for your Drupal update and upgrade paths

by Albert 43 weeks 14 hours ago
Introduction Simpletest is great for unit and functional tests for your Drupal modules; you can also use Simpletest to automatically test your module updates and upgrade path. The process is similar in Drupal 7 and Drupal 8, and this article will show you how to do it, and include some simple example modules. Terminology First, some terminology: updates of your module remains within the same... » read more
( comments, last 43 weeks 14 hours ago)

Creating and applying a Drupal patch with binary files

by Albert 43 weeks 3 days ago
I am normally in the habit of creating my patches with the commands "git diff 123456 abcdef > patch.patch" (where 123456 and abcdef are commits); and applying the patch with "patch -p1 < patch.patch". This works fine unless you have binary files. For example, for this issue I needed to include a new .gz file in my patch, and the above technique was causing a fail. To create and apply... » read more
( comments, last 43 weeks 3 days ago)

Using conditional stylesheets (IE) with Omega

by Albert 48 weeks 1 day ago
As described here, conditional_styles does not work with Omega for Drupal. Here's what to add in your template.php file for this to work: <?phpfunction YOUR_THEME_NAME_preprocess_html(&$variables) {    // Add conditional stylesheets for IE  drupal_add_css(path_to_theme() . '/css/ie.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' =... » read more
( comments, last 48 weeks 1 day ago)

Drush, Drupal 8, MAMP, and the magic_quotes_gpc problems

by Albert 50 weeks 1 day ago
The latest version of Drush gives me this error, but only with Drupal 8 sites: PHP's 'magic_quotes_gpc' and 'magic_quotes_runtime' settings are not supported and must be disabled.Drush command terminated abnormally due to an unrecoverable error.          I'm using MAMP, so I turned all magic quote related stuff off in /... » read more
(3 comments, last 38 weeks 2 days ago)

Créer un newsletter HTML avec le feature dCycle Generate HTML Newsletter et simplenews

by Albert 51 weeks 2 hours ago
Les liens suivants utilisent le domaine example.com. Il faut installer le module https://github.com/alberto56/generatecivihtml sur votre site et changer les liens example.com par votre propre nom de domaine. Pour créer un newsletter avec dCycle Generate HTML Newsletter: aller créer un nouveau newsletter issue. Choisir le gabarit qui vous convient. (vous pouvez créer de nouveaux gabarits ici)... » read more
( comments, last 51 weeks 2 hours ago)

Sending HTML emails using simplenews on Drupal 6

by Albert 51 weeks 2 days ago
- download and enable simplenews and mimemail - admin/settings/simplenews/newsletter: set format to HTML and save - go to node/add/simplenews, and make sure Wysiwyg is disabled (click on Deactivate rich text, for example) - paste full HTML in the body section, and send your email. (Actually creating good HTML is outside the scope of this tutorial!) - you might have to run cron on your site for... » read more
(1 comments, last 37 weeks 4 days ago)

Setting up per-forum search on Drupal 6

by Albert 51 weeks 2 days ago
Install advanced_forum 6.x-2.x and nodecomment 6.x-2.x. Enable advanced_comment, nodecomment and core search module. (nodecomment might take a few minutes to be enabled, depending on the number of nodes on your site. You might also have an out of memory error while enabling the module, just ignore it). Run cron on your site If you have a non-English site, go to admin/build/translate/search, and... » read more
( comments, last 51 weeks 2 days ago)

Using more than one SSH private key

by Albert 1 year 11 hours ago
Say you have your regular SSH public-private key pair for most of what you do, and you need to have another SSH public-private key pair for specific servers (this doesn't happen often, but there are some edge cases where there is no easy alternative). start by creating a new directory in your home folder, called .ssh-whatever, and put your public private key pair (or just your private key, that... » read more
( comments, last 1 year 11 hours ago)

Selenium: testing Javascript with Simpletest on Drupal 7

by Albert 1 year 2 weeks ago
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/... » read more
( comments, last 1 year 2 weeks ago)

Enabling a theme in D7 and setting it to default

by Albert 1 year 3 weeks ago
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 1 year 3 weeks ago)

Using prepopulate on Drupal 7's contact form

by Albert 1 year 3 weeks ago
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 1 year 3 weeks ago)

Installing / debugging MAMP on Mac OS X

by Albert 1 year 7 weeks ago
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 1 year 7 weeks ago)

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

by Albert 1 year 10 weeks ago
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 1 year 10 weeks ago)

mysql server gone away, Drupal 6 and MAMP

by Albert 1 year 13 weeks ago
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 Troubleshooting. If your mysql server won't start try this: - make sure there are no newlines in your startMysql.sh file - sudo chgrp admin /Applications/MAMP... » read more
(1 comments, last 47 weeks 6 days ago)

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

by Albert 1 year 32 weeks 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... » read more
( comments, last 1 year 32 weeks ago)

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

by Albert 1 year 33 weeks 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
(3 comments, last 36 weeks 4 days ago)

Dev-stage-prod in Drupal: a formalized workflow

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

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

by Albert 1 year 40 weeks 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 1 year 40 weeks ago)

Definitive Guide to Drupal 7 Launched!

by Albert 1 year 40 weeks 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
(5 comments, last 20 weeks 2 days ago)

Lancement du Definitive Guide to Drupal 7 !

by root 1 year 40 weeks 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 1 year 40 weeks ago)

Installing a wyiswyg editor on Drupal 6 and 7

by Albert 1 year 40 weeks 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 1 year 39 weeks ago)

Drupal on a virtual host in MAMP on Mac OS X

by Albert 1 year 42 weeks 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
(2 comments, last 4 weeks 19 hours ago)

Adding a user to a group in Mac OS X

by root 1 year 42 weeks 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 1 year 42 weeks ago)

Using hook_update_n() for to update your Drupal website database

by Albert 1 year 51 weeks 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 won't have an implementation of... » read more
(3 comments, last 19 weeks 5 hours ago)

Call to undefined function image_gd_check_settings()

by root 2 years 2 weeks 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
(1 comments, last 24 weeks 1 day ago)

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

by Albert 2 years 5 weeks ago
(EDIT: 28 oct. 2011, changed the Drupal 7 version to reflect changes in the 7.9 implementation -- updated solution should work for all versions of D7, see also this issue) 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.... » read more
(6 comments, last 22 weeks 12 hours ago)

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

by Albert 2 years 5 weeks 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 2 years 5 weeks ago)

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

by Albert 2 years 15 weeks 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 1 year 18 weeks ago)

Finding files by name in Linux

by Albert 2 years 18 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 2 years 18 weeks ago)

Using aliases to navigate the command line

by Albert 2 years 18 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 2 years 18 weeks ago)

Moving WMVs from Vista to a mac for video editing.

by Albert 2 years 28 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 2 years 17 weeks ago)

Sharing between Mac OS X Snow Loepard and Windows Vista

by Albert 2 years 28 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 2 years 28 weeks ago)

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

by Albert 2 years 31 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 2 years 31 weeks ago)

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

by Albert 2 years 33 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
(2 comments, last 13 weeks 1 day ago)

A hosting platform -- the end of an experiment

by Albert 2 years 33 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 2 years 33 weeks ago)

Converting a word doc to pdf

by Albert 2 years 36 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 2 years 18 weeks ago)

Displaying the total number of rows in a view

by Albert 2 years 47 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 2 years 47 weeks ago)

how to upgrade a module to drupal 7

by Albert 2 years 47 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 2 years 47 weeks ago)

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

by Albert 2 years 49 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 1 year 27 weeks ago)

Creating actions for use with views bulk operations

by Albert 3 years 2 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
(1 comments, last 38 weeks 3 days ago)

Great site for checking nameservers

by Albert 3 years 8 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 3 years 8 weeks ago)

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

by Albert 3 years 10 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
(5 comments, last 16 weeks 1 day ago)

Counting inodes (files, folders, symlinks)

by Albert 3 years 11 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 3 years 11 weeks ago)

Setting up wysiwyg with image upload on Drupal

by Albert 3 years 11 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 1 year 47 weeks ago)

Un YouTube pour les mp3

by Albert 3 years 27 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 1 year 48 weeks ago)