Skip to content

Commit

Permalink
Merge pull request #10 from beat/patch-2
Browse files Browse the repository at this point in the history
This fixes taking in account the published state
  • Loading branch information
infograf768 committed Apr 29, 2014
2 parents c0c5466 + b8482b0 commit e8a0933
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/cms/helper/tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals
->select('MAX(ct.type_title) AS content_type_title, MAX(ct.router) AS router')

->from('#__contentitem_tag_map AS m')
->join('INNER', '#__ucm_content AS c ON m.type_alias = c.core_type_alias AND m.core_content_id = c.core_content_id AND ( c.core_publish_up = ' . $nullDate . ' OR c.core_publish_up <= ' . $nowDate . ') AND ( c.core_publish_down = ' . $nullDate . ' OR c.core_publish_down >= ' . $nowDate . ')' )
->join('INNER', '#__ucm_content AS c ON m.type_alias = c.core_type_alias AND m.core_content_id = c.core_content_id AND c.core_state IN (' . implode(',', $stateFilters) . ')' . (in_array('0', $stateFilters) ? '' : ' AND (c.core_publish_up = ' . $nullDate . ' OR c.core_publish_up <= ' . $nowDate . ') AND (c.core_publish_down = ' . $nullDate . ' OR c.core_publish_down >= ' . $nowDate . ')'))
->join('INNER', '#__content_types AS ct ON ct.type_alias = m.type_alias')

// Join over the users for the author and email
Expand All @@ -538,8 +538,7 @@ public function getTagItemsQuery($tagId, $typesr = null, $includeChildren = fals

->join('LEFT', '#__users AS ua ON ua.id = c.core_created_user_id')

->where('m.tag_id IN (' . implode(',', $tagIds) . ')')
->where('c.core_state IN (' . implode(',', $stateFilters) . ')');
->where('m.tag_id IN (' . implode(',', $tagIds) . ')');

// Optionally filter on language
if (empty($language))
Expand Down

0 comments on commit e8a0933

Please sign in to comment.