?
Referenced as Pull Request for: # 5606
avatar heleneross
heleneross
3 Nov 2014

Joomla version 3.3.6
Using mod_tags_similar, the helper returns items marked as published using core_state=1 but it also returns items which have expired as no check is made on the core_publish_up or core_publish_down columns

Tested by editing the article published state and publish up and down dates.

I fixed it by editing mod_tags_similar/helper.php

added at line 42

$now         = JFactory::getDate()->toSql();
$nullDate    = $db->getNullDate();

and then modified the published tags where query

// Only return published tags
$query->where($db->quoteName('cc.core_state') . ' = 1 ')
     ->where('(' .$db->quoteName('cc.core_publish_up') . '=' . $db->quote($nullDate) . ' OR ' .$db->quoteName('cc.core_publish_up') . '<=' . $db->quote($now) . ')')
     ->where('(' . $db->quoteName('cc.core_publish_down') . '=' . $db->quote($nullDate) . ' OR ' .$db->quoteName('cc.core_publish_down') . '>=' . $db->quote($now) . ')');
avatar heleneross heleneross - open - 3 Nov 2014
avatar jissues-bot jissues-bot - change - 3 Nov 2014
Labels Added: ?
avatar brianteeman brianteeman - change - 3 Nov 2014
Category Tags
avatar infograf768
infograf768 - comment - 4 Nov 2014

Can you make a PR?

avatar brianteeman
brianteeman - comment - 3 Jan 2015

OK I went ahead and created the PR #5606
Please test


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/4979.
avatar brianteeman brianteeman - change - 3 Jan 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-01-03 21:22:59
Closed_By brianteeman
avatar brianteeman brianteeman - change - 3 Jan 2015
Closed_Date 2015-01-03 21:22:59 2015-01-03 21:23:00
avatar brianteeman brianteeman - close - 3 Jan 2015

Add a Comment

Login with GitHub to post a comment