Main menu

Drupal 7: Taxonomy language filter is absent in Views

Published by dnovikov on Thu, 08/25/2011 - 17:35

When we have Taxonomy translation module enabled we can set taxonomy translation mode to "Translate" - this means that different terms can be created for each enabled language on the site. But when we output these terms with Views ("Taxonomy" view type) they're not filtered automatically by the current language and we can't override this applying a filter... language filters are absent for taxonomy terms. I found a quick solution with few lines of code:

Possible PHP file-to-memory mapping technique

Published by dnovikov on Sun, 07/10/2011 - 15:36

As widely known, PHP doesn't support direct access to file-to-memory mapping techniques. Here is one I've discovered while working with large character-separated files:

Gallery Assist + Image FUpload issue: error 503

Published by dnovikov on Wed, 05/25/2011 - 14:54

I've recently discovered a very strange issue with Gallery Assist. In normal condition it allows to upload any kind of image files (at least, specified in settings). But on some server configurations a problem happens when uploading PNG files. Upload indicator infinitely stays at initial position and nothing happens. I've tried to install Image FUpload module, which is based on SWFUpload Flash plugin. It just reported about the error 503 when uploading PNG. But all worked fine on few another servers. Does anyone know how to fix this? Please comment or mail me.

Enable comments for existing nodes

Published by dnovikov on Tue, 05/17/2011 - 17:07

You know how easy comments can be added to Drupal nodes. You need to just enable appropriate module and set up node types. But comments will appear only for new nodes, not existing. It depends on 'comment' column in 'node' table. Fix it with query:

UPDATE node SET comment = 2 WHERE type IN ('your_node_type'[,...])

WebAsyst to Drupal import module

Published by dnovikov on Thu, 03/31/2011 - 16:13


Some time ago I was doing a site migration and received a task of importing WebAsyst shop-script products to Drupal nodes. Also there was a need to import:

1. Products categories -> taxonomy

2. Categories images -> taxonomy images

3. Additional products fields -> CCK fields

4. Products images -> image fields

CSV parsing problem with PHP's fgetcsv

Published by dnovikov on Mon, 03/21/2011 - 17:35

Just a short note. I noticed that fgetcsv is not always correctly working with UTF-8 CSV files. It can be fixed by surrounding all fields with quotes or another enclosure symbol.

Quick tabs block caching problem

Published by dnovikov on Wed, 02/23/2011 - 17:04

Drupal's contributed Quick tabs module has a number of issues. Bug with enabled block caching is very popular among others. New sites will not experience this problem as the newest Quick tabs version is installed, but old ones (till quicktabs 2.0 rc2 or rc3) still have it. The problem can be decided in 3 steps:

1. Download and install the latest Quick tabs version.

2. Run update.php on your site.

3. Update "blocks" table with something like following: UPDATE blocks SET cache = -1 WHERE module = 'quicktabs'.

E-mail domain name Drupal's built-in validation

Published by dnovikov on Mon, 02/21/2011 - 14:02

Generally speaking, there is a plenty of issues about the emails validation and valid_email_address function on I'm not going to discuss neither its RFC compliance nor implementation. For me, there is only one issue with this function: it allows domain names without a dot. It accepts, for example, mail@localhost or mail@gmailcom. Not malicious itself such behavior sometimes is very undesirable, especially if you're working with something like paid subscriptions.