DRUPAL-5

When e-commerce won't create products ...

Submitted by Frederic Marand on

I was working on an existing site today, and after installing the e-commerce 3.4 suite (EC), noticed something was very weird: product type modules were enabled, all basic EC modules were there too, and yet, when I created products by hand, the "Anonymous purchase" fieldset appeared, but nothing else from EC.

Worse, when saving the new products, they were properly created in the {node} table, but never appeared in the {ec_product} table, which caused them never to appear as products in the admin products list of the product view available to users. What could be going on ?

Multisite and dynamic configuration items in Drupal : help from Apache

Submitted by Frederic Marand on

Having recently merged a number of separately configured sites into a single consolidated multisite, I found myself with URLs like:

http://www.site1.com/sites/www.site1.com/files/somefile.png

...on all except the main site of the multisite configuration.

Although img_relocator allows me to just type things like:

<img src="somefile.png" />

... and still have these URLs be automagically generated, they still appear to those users who actually look at the URLs.

Enter mod_rewrite

Abandon all hope, ye who enter here

With these sites running over Apache 2.x, mod_rewrite offers a simple way to rewrite the files URLs: in the Apache site definition file for the vhost describing the site, we can use:

Testing Newsflash

Submitted by Frederic Marand on

2007-08-23: site updated to Newsflash 0.12 : the Helvetica selector is gone, which means some of the content of this post no longer applies.

newsflash screendump in Opera, Firefox and MSIEI've just given this blog a facelist using the Roople NewsFlash theme, and I'm somehow dubitative about it:

  • on the plus side
    • the 3 "user" blocks above content and the 3 other ones below content are a neat feature
    • the color balance feels good to me, in either of the 3 predefined colors
    • overall, it works way better than my "nested" theme a few months ago
  • on the minus side
    • although I tried various content layouts using the 3 user blocks, I couldn't get anything fit properly in them: it seems these will be specifically useful when a site has snippets of equivalent size to fill in them. This could probably be news (the theme isn't called Newsflash for nothing) or ads
    • on my screen at least, the text appears blurry, especially in Firefox
    • generally speaking, it seems bold font is used too much, with essentially the same character sizes for title, tags, and various links. I think some more gradation in font effects would be welcome
    • the site slogan is incorrectly positioned in MSIE
    • in Opera and Firefox, the site slogan ascenders collides with the site name descenders
    • the logo display code is wrong (relative URLs); I had to tweak it in page.tpl.php to accomodate the site folder structure
    • the logo setting doesn't apply properly

Downloading modules when drupal.org is offline

Submitted by Frederic Marand on

Drupal.org being unavailable quite frequently these days, some may find it hard to download the module of their choice.

Luckily, the downloads are static files served as public downloads outside Drupal itself: all it takes is knowing the proper URL, and they are all gathered on ftp://ftp.drupal.org/pub/drupal/files/projects, just waiting for your favorite FTP browser.

Creating Google Gadgets within Drupal

Submitted by Frederic Marand on

2009-05-24: UPDATE: now ported to D6

screendump showing the Drupal API google gadget Having recently discovered the Google Gadgets API, and being on vacation this week proved too much of a temptation: I had to build one using Drupal. Here is a way to do it, as a module creating a Google Gadget to directly search http://api.drupal.com/ from the iGoogle home page. User preferences allow searching the various versions of the API and default to Drupal 5.

First spammer working around captcha

Submitted by Frederic Marand on

After almost six months without abuse following the installation of the captcha module, a spammer found its way through it, to promote a ringtones site.

Not that it did him/her much good, since comments are premoderated anyway, but still...

Sheer luck, of astute pattern matching and module workaround ? Oh well, it's still six months of peace gained. Well worth the almost nonexistent hassle, it seems.

Multiple entries with Zend_Config_XML

Submitted by Frederic Marand on

I had been in need of a class to read config data into both the PHP-GTK OSInet back-office front end, and the back-office client UI for the Drupal 5.x offload module, and hesitated between various solutions, ranging from roll-our-own to the various frameworks out there and the existing PEAR packages.

Zend Framework logoSince Zend Framework appears to be well on its way to becoming a standard for professional PHP developers, I figured I'd give it a spin :

Nodify, Objectify, CRUDify

Submitted by Frederic Marand on

Funnily enough, my recent post about wishes for Drupal happened just before discussion started afresh on the recurring "everything-as-a-node" theme, in which I seem to have been played the re-animator part this time.

Thinking deeper upon this issue, I figured it would be interesting to see where Drupal stands currently (in D5) regarding the reularity and orthogonality of the hook system and most visible content-related entities: nodes, comments, terms, vocabularies, and node types.

The resulting table is attached to this post (OpenDocument format), and shows some interesting results: