Posted by toemaz on April 23, 2007 at 8:11am
| Project: | Recent Changes |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I included a patch for recent changes which adds the following functionality:
- A settings page so the admin can configure the module
- Set default filtering on one specific node type, in case the admin would like to hide the filter
When adding the default filter functionality, I encoutered a problem:
<?php
$where .= " AND n.type = '" . check_plain($node_type) . "'";
?>resulted in some cases in a SQL query with a bad WHERE statement: " WHERE AND n.type = 'foo' ... ". The solution is also provided in this patch:
<?php
$where .= ($where ? ' AND ' : '') . " n.type = '" . check_plain($node_type) . "'";
?>| Attachment | Size |
|---|---|
| recent_changes_settings.module.patch | 3.88 KB |
Comments
#1
The previous patch was not good. Here is a fixed one.