Download & Extend

Adding settings page and filter on one nodetype

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) . "'";
?>
AttachmentSize
recent_changes_settings.module.patch3.88 KB

Comments

#1

The previous patch was not good. Here is a fixed one.

AttachmentSize
recent_changes_settings.module_0.patch 3.46 KB
nobody click here