Please exempt custom 403 and 404 (page not found, access denied) from the popular content block. Always do it, never list either of these two pages. Nobody wants to see them there.

Technically I could think of two solutions:

a) Put these exceptions into the relevant SELECT statements.

b) For better performance, let the SELECT statements speedily run their course and aim for two more entries. For example, if the user wants the top 10, select the top 12. If 403 or 404 is among the results, delete. Then take the top 10.

Actually a good SQL processor should figure that out on its own from solution a), but I guess, with the different databases in the field you can't be sure.

Hans-Georg

p.s. Does anybody have a patch for 6.x? I wouldn't mind seeing fewer entries in the list. Just deleting these two rows from the popular content blocks would be sufficient.

Comments

kbahey’s picture

The proper solution is not to have these pages as true nodes.

The Custom Error module in contrib http://drupal.org/project/customerror does exactly that. By making them non-nodes, we avoid all these problems.

If this works for you, then mark this issue as wont fix.

hgmichna’s picture

Doesn't exist for Drupal 7. Doesn't even exist for Drupal 6, not even a beta test version, even though Drupal is already at 6.6.

Thanks, but forget it. No more third-party modules for me! They are a Damokles sword constantly hovering above my head already. And this one is not a reliable module. I would never introduce such a thing into a production-grade Drupal installation, and nobody in his right mind should do that.

Besides, don't you find it strange that Drupal has something close to a bug, and you need a third-party module to keep subduing it? Why not simply fix the Drupal code for the popular content block? These are very few extra lines of code, and the problem is gone for good.

Moreover, I'm not convinced that custom 403 and 404 should not be nodes. Why not? The only difference is that they are, by definition, unpopular. That doesn't mean they shouldn't be nodes.

kbahey’s picture

I wrote the customerror module, and use the 5.x version for this module on many live sites. Works well.

It is small enough to be audited, or even write a simpler version of it if you look at its code.

The module does exist for 6.x as a -dev release. When enough people have reported it works well, a stable release will be created.

But anyway, suit yourself there. You don't have to use it if you don't want to.

As for the issue at hand, I oppose adding any special cases in the code, as it creates exceptions, complexity and bloat, and become a long term maintenance issue.

hgmichna’s picture

I wrote the customerror module, and use the 5.x version for this module on many live sites. Works well.

Thank you for providing this module, which fulfills an urgent need.

However, you are almost a whole Drupal version behind, and that makes your module questionable for any serious site. This issue is about Drupal 7, and since no version of your module for D7 exists, your comment is not really relevant.

As much as I appreciate your effort, third-party modules are always a problem unless they have a proven history of timely co-development with Drupal and a credible assurance by the author that the module will still be updated for future Drupal versions.

As for the issue at hand, I oppose adding any special cases in the code, as it creates exceptions, complexity and bloat, and become a long term maintenance issue.

Hehe, that's an interesting philosophical point. The whole of Drupal is a special case, each block is a special case, 403 and 404 themselves are utterly special cases, yet they have been put into Drupal's code, and last, but not least, Drupal is there to fulfill the needs of its users, not of its programmers.

This particular "special case" is one that goes on the nerves of everybody who uses the popular content block. Seen from this angle, special as it may be, it is a very widespread case. To me it seems more like a bug than a special case.

Alternative proposal

How about making it less special? Let the user enter a filter list of node IDs (or perhaps even simple text strings or, alternatively, regular expressions) that are to be exempted from the popular content and other, similar blocks like active and recent forum topics. That's a little more programming, but it would also be more general and useful.

A practical example for this would be a test forum where some users work on the same article again and again for testing purposes. This article would creep up in certain popular content blocks, but is not really desired there.

Dave Reid’s picture

Status: Active » Closed (duplicate)