Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently creating taglists by content type lists all content of that type regardless of status. It may be useful to be able to specify what status(es) you'd like to filter by, but in the meantime here's a quick and dirty fix to remove unpublished nodes from the taglist.
Line 207 of taglist.load.inc is currently:
$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = "%s" order by n.%s %s', $contenttype, $tl_properties['sort_method'], $tl_properties['sort_sequence']);
Replace this with:
$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = "%s" AND n.status > 0 order by n.%s %s', $contenttype, $tl_properties['sort_method'], $tl_properties['sort_sequence']);
Comment | File | Size | Author |
---|---|---|---|
#1 | 751216_linodef_filter_unpublished_nodes.patch | 4.77 KB | Roi Danton |
Comments
Comment #1
Roi Danton CreditAttribution: Roi Danton commentedThanks, added filter and committed. If you find any bugs then report them here, pls (corresponding Patch attached).