news category browse lists/counts inactive 'draft' articles

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
glass
Forum Members
Forum Members
Posts: 32
Joined: Tue Sep 09, 2008 4:51 pm

news category browse lists/counts inactive 'draft' articles

Post 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  ???
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm
Location: Raalte, the Netherlands

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

Post by RonnyK »

I dont recall having seen this behaviour..... Will do some testing.

On what version of CMSMS are you experiencing this?

Ronny
Post Reply

Return to “Modules/Add-Ons”