Page 1 of 1

news category browse lists/counts inactive 'draft' articles

Posted: Tue Apr 28, 2009 4:33 pm
by glass
If you create a category browse page for the news module, this will create a page which lists all the news categories and the number of articles in each category.

However, this numbering includes articles that have a status of 'draft' (i.e. articles which the front-end should not display).

As a very short-term solution to this one can edit modules/News/action.browsecat.php, around line 37:

from:

$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=?";

to

$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=? AND status != 'draft'";

Is this a feature or a bugĀ  ???

Re: news category browse lists/counts inactive 'draft' articles

Posted: Tue Apr 28, 2009 6:07 pm
by RonnyK
I dont recall having seen this behaviour..... Will do some testing.

On what version of CMSMS are you experiencing this?

Ronny