Maintaining Drupal Userreview module
I'm maintaining the Drupal userreview module now and hope to do the first round of bug fixing before Christmas.
I'm maintaining the Drupal userreview module now and hope to do the first round of bug fixing before Christmas.
Let's face it: Updating a Drupal instance can be a pain, especially, if your Drupal installation is full of custom patched, like mine is. Wouldn't it be nice to have an installation that can be updated safe and easily? This article is about how I achieved this.
As you may know, Drupal uses CVS. In simple words, CVS allows several developers to work on the same file at the same time. Therefore developers can apply changes without overriding the changes of others - at least to some extend. Different changes to the same line of course need manual resolution.
Maybe you already know the famous Drupal error "Unknown table 'n'". It looks like this:
user warning: Unknown table 'n' in where clause query: SELECT DISTINCT(node.nid), node.type AS node_type, node.title AS node_title, node.changed AS node_changed, users.name AS users_name, users.uid AS users_uid, node.created AS node_created, node_counter.daycount AS node_counter_daycount FROM node node LEFT JOIN users users ON node.uid = users.uid LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid INNER JOIN node_access na ON na.nid = node.nid WHERE (na.grant_view >= 1 AND ((na.gid = -1 AND na.realm = 'all') OR (na.gid = 0 AND na.realm = 'og_public') OR (na.gid = 0 AND na.realm = 'og_all') OR (na.gid = 3 AND na.realm = 'og_subscriber') OR (na.gid = 4 AND na.realm = 'og_subscriber') OR (na.gid = 0 AND na.realm = 'cac_lite'))) AND (n.moderate != 1) AND (node.status = '1') ORDER BY node_counter.daycount DESC LIMIT 0, 5 in /home/orbit42/public_html/includes/database.mysql.inc on line 120.
This error is caused by some module "rewriting" a query of some other module, each of them not aware of each other. This is a powerful Drupal feature, yet it also is highly error prone - as the lots of error alike show. Here's how to deal with it.
I once wrote about how captchas helped me to get rid of WordPress comment spam. After the last - unfortunately quite successfull - spam attack on my now Drupal-powered web site, I decided to implement the same approach. Simple spoken, captchas are a kind of challenges that should ensure a real human is submitting a form, not a machine. Here are my experiences.
The Drupal related nodes code snippet has been updated to work with Drupal 4.7.
The Drupal TotalFeeds Module has been updated to work with Drupal 4.7. Additionally, two patches provided by Daniel Ellison have been incorporated. The module now supports feeds for all comments, and the dc:creator tag. You can download it here. The version for Drupal 4.6 is still available here.
Peter Van Garderen talks about Drupal as a MVC framework. His essay is well worth a reading and so are the comments. Peter writes that
I had considered Drupal as an option earlier but I had been swayed by all the buzz in the tech press and blogosphere about the new generation of open source MVC frameworks that are promising to improve the speed and quality of web application development.
Since Drupal has been around a bit longer than the more recent MVC frameworks, it never thought to sell itself to new developers like myself as a MVC framework. It started out as website content management system and has grown over the past five years into a swiss army knife type toolkit for building websites that is host to an active community of contributors.
Swiss army knife: That's to the point, couldn't agree more :-). However, he concludes that Drupal is not a true MVC framework, but that developing is promising.
I'm currently experimenting if and how presenting users links to other content of this site affects the site navigation (and how you may have guessed: Yes, I got myself a Google Analytics account, too). First I decided to display related articles beneath each articles. Now I'm trying a "Most popular" block that displays the top five pages visited within the last three days. Here's how I did it.
I just hacked the following code into my node.tpl.php to display five possible related nodes beneath each story. There also is a module doing this, however, I wanted to reuse the build in search, since it offers this nice snippets feature.
I found the build in feed support of Drupal to be a bit poor. It only offers RSS feeds, publishes only teasers, but not full text and doesn't allow to set an image for your feed. Atom support is missing and there is no comment feed. There are modules for both atom and comment feed, though.
That's why I decided to write a module for general feed handling purposes. The module is still very beta, however, it already powers this site's feeds. You can download it here. Be sure to read the INSTALL.txt file, since this module requires a hack to the node module.