Drupal

Seen on drupal.org forums: "Site immigration"

Chicago Immigration Reform Protest - HR4437 Instant classic. I guess the Drupal association will need to start debating about immigration laws very soon. It’s getting critical.

Technorati Tags:

Drupal CVS contributor now!

“flevour, We are pleased to inform you that your CVS account request has been approved. It will be activated within one or two hours.”

And this is my first commit.
So little is enough to make me happy sometimes :)

Technorati Tags:

Drupal: changing "files" directory configuration setting

I spent a great of yesterday morning re-organizing the directory structure on my webhost, where this site along with my client’s ones are stored.
The fact is I am moving toward a Drupal multi-site installation, that is a single set of core files serving multiple sites at the same time. Currently I am running three sites (including this one) with a shared code base, but I am planning to start integrating some more very soon. The fact is with a single code base to maintain, things are simpler to manage (because everything is under the same directory) and upgrade (in case of a patch-release you need to upgrade only one code base).

the brave decision

Soon after I begun this task, I realized I’d have to change the files directory location, because otherwise sites were saving uploaded files in the same directory. In the Drupal administration page there is a warning about this action: “Changing this location after the site has been in use will cause problems so only change this setting on an existing site if you know what you are doing.”
I needed to get this done anyway, so I assumed I knew what I was doing.

one error to doom them all

One site had more than 200 files uploaded through Drupal, so I had to be careful about what I was doing. Manually re-inserting all those images would have killed me and my social life for a couple of days if not more. So I put the site on maintainance mode, notified all editors to keep away from the site for a while and started hacking my way through the changes. I changed the “files/” directory location setting to “sites/SITEDOMAIN/files” and went around checking if everything was displaying correctly (not true for any defintion of “Everything”: I actuall grepped my httpd logs for “files/” string, so I knew where and what to check after change). The site uses imagecache module for image rescaling and resizing and I expected it to be the biggest source of headaches. But instead it turned out all imagecached images were being correctly linked to the new file location.

the case for some elite SQL trickery

Instead I had some minor problems with CCK file fields. They present a strange behaviour which I still have to determine whether it is a bug or a feature. The image will display correctly regardless that the saved filepath in the files table is relative to the Drupal root or to the “files/” direcory location setting. Anyway in my case the files were stored with full path from Drupal root, so the old “files” location was embedded in the table. I just ran this query to fix things up:
UPDATE `files` SET `filepath` = REPLACE(`filepath`, "files/", "sites/SITEDOMAIN/files/");

who greps last greps better

I then rapidly scanned the site checking logs for 404 errors while visiting the sample pages I selected during the first steps grepping the logs. Everything seemed to work flawlessly. I then put the site back online and notified editors. I am now waiting to see if any of them reports problems of any kind. Anyway I am pretty satisfied, it hasn’t been the nightmare I expected it to be. Now I have a clean and rational installation, with all files, modules and themes under the sites/ directory, which sits out of the Drupal installation directory and is simply linked in the Drupal root.

First post on the new platform, Drupal5

I am happy to announce I am writing this post on Drupal5.
I have took the time to change theme (even if, as always in such situations, I feel like to give a strong rebranding to the whole flevour.net as a concept, more on this some future day) and install a few modules for my writing pleasure.

Most importantly:

  • I have converted all the posts from ‘blog’ to ‘story’. Blog content type in Drupal is really for site where there are different bloggers. With this move I get rid of the annoying and redundant “flevour’s blog” link, which, among other things, affects negatively search engine results (because blog/1 is infact a duplication of the home page). This resulted in getting the “recent blog posts” vanish in thin air and in me recreating it with Views, the FinalModule™. To Merlin always respect and appreciations for putting together such a great piece of code;
  • I had to patch the Flickr module to make it parse the private markup I created for the 4.7 version. When I embed a Flickr photo I just type {FLICKR_PHOTO_ID} and I am all set;
  • I realized that probably from its beginnings this blog had “Full HTML” input format set as default, that means Anonymous users could post almost anything they wanted going unmoderated and that’s a big risk even if Drupal has a solid XSS check system. For this reason I have set “Filtered HTML” as the default input format, alas incurring in this old Drupal issue, which I fixed forking the filter core module in the site directory and forcing the “Full HTML” input format for user #1 (which happens to be me) in the filter_form function. This modification wins the MostViolentAndBrutalHackIHaveEverWritten. Think programming elegance gone nuts;
  • For my own editing pleasure I installed the Textile module which lets me write posts forgetting about HTML tags, which I is cool (no, I am not for those kinky WYSIWYG-like editors; I say “WYSIWYG-like” because they almost always don’t WhatYouExpect). You’ll notice this for the exponential growth of links in posts;
  • For most flexibility I installed Google Adsense and Google Analytics module. This means no more theme editing to embed scripts tags and code. A simple and slick interface makes it all. And you also get little features for free (like ads are not displayed when you are logged in, so you don’t skew page views). Kudos to developers;
  • For some improved link juicing I installed the Technorati module and the best antispam module around, Akismet. To complete the HappyBlogger™ suite, Pathauto, for automatic nice URL generation;
  • Finally Dba for periodic database backup.

Technorati Tags:

Slowly upgrading

I’ll start the upgrade process for this blog in a few minutes. I have been shamefully running Drupal 4.7.3, neglecting to upgrade it for almost one year (4.7.3 was released on Aug 2006).
I’ll first upgrade to 4.7.7, have a break and then go up to 5.2. We’ll see how it goes.
I know you spend half of your daytime surfing this site, so don’t fear if you see something broken in the next few hours!

Technorati Tags:
Syndicate content

Recent blog posts

Adsense