Bug in News module 2.12.10 (category list can't be filtered)

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
yankee80
Forum Members
Forum Members
Posts: 34
Joined: Mon Apr 10, 2006 2:45 am

Bug in News module 2.12.10 (category list can't be filtered)

Post by yankee80 »

Hello CMSMS friends,

I think I have found a bug in later versions of the News module (hopefully this is the right part of the forum to post it).

I have two identical sites with PHP/MySQL latest versions.

Site 1:
CMSMS 1.8.1
News 2.10.6

Site 2 (cloned from site one then upgraded to):
CMSMS: 1.11.4
News: 2.12.10

On site 1 the tag below shows me a list of all news categories that are sub categories of the "Hotels" news category
{news action="browsecat" category='Hotels*'}

On site 2 the same tag produces no output

If I change the tag to
{news action="browsecat"}

every single news category is listed (as expected)

I'm not a developer, but my conclusion is that this is a bug in News 2.12.10 (which the module manager claims is the latest version).

many thanks in advance for any help with this issue.
compufairy
Forum Members
Forum Members
Posts: 183
Joined: Sun Sep 07, 2008 10:47 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by compufairy »

Hi there,

I am not a die hard programmer, but an * in your call can't be good, in many programming languages that is used to calculate (multiply). In all my technical innocence I think Smarty3 does not like your * in the category tag. Maybe Smarty 2 did not mind, but my 2 cents is that Smarty3 surely will.

I am quite sure there is no bug in News...

Anne
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur..." (Red Adair)
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: Bug in News module 2.12.10 (category list can't be filte

Post by cb2004 »

A * in a module call usually relates to showing the children of so it should be fine.

Do you have pretty urls on or off?
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: Bug in News module 2.12.10 (category list can't be filte

Post by cb2004 »

Ok, I just had a play on a test site. I suspect the category parameter is only used for the summary view. If you wish to display just specific categories using the browsecat action I would do some smarty stuff in a template instead.
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: Bug in News module 2.12.10 (category list can't be filte

Post by staartmees »

CMSMS 1.8.1 is no longer supported and isn't safe anymore. Upgrade to cms 1.11.5 as quick as possible.
compufairy
Forum Members
Forum Members
Posts: 183
Joined: Sun Sep 07, 2008 10:47 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by compufairy »

lol, I should stick to marketing ;)
"If you think it's expensive to hire a professional to do the job, wait until you hire an amateur..." (Red Adair)
yankee80
Forum Members
Forum Members
Posts: 34
Joined: Mon Apr 10, 2006 2:45 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by yankee80 »

cb2004 wrote:Ok, I just had a play on a test site. I suspect the category parameter is only used for the summary view. If you wish to display just specific categories using the browsecat action I would do some smarty stuff in a template instead.

thanks for your analysis and replies CB

Pretty URL:s are On

I don't see the rationale behind disabling a feature that works perfectly in an older CMS version.

I'd really appreciate if you could point me in the right direction on how to filter the categories using smarty? Should I parse the output and remove anything that doesn't start with "Hotels"?
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Re: Bug in News module 2.12.10 (category list can't be filte

Post by cb2004 »

If you can do something within a template there is no need to maintain features within the code.

In the category template within the foreach use {$node|print_r} and you can play around with what is returned.
yankee80
Forum Members
Forum Members
Posts: 34
Joined: Mon Apr 10, 2006 2:45 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by yankee80 »

I hope someone can tell me whether I've run into a dead end here.

Goal: To filter the output of the news module's category list to include only subcaterories of main category "ArtEntertainment"

The sub categories are called:
ArtEntertainmentCat1
ArtEntertainmentCat2
ArtEntertainmentCat3

I call the news module like this from my HTML template:

{news action="browsecat" category='ArtEntertainment*' browsecattemplate='SubCatNew' }

and end up with no output (because the "category" and action="browsecat" parameters are not allowed together anymore).

As advised by cb2004 I'm trying to parse the output in the news category-browser template (to filter out unwanted categories) BUT how can I pass the name of the wanted category "ArtEntertainment" available as a variable in the news module browse category template?


I've tried by calling the news module with a new home made parameter "cat"
{news action="browsecat" cat='ArtEntertainment*' browsecattemplate='SubCatNew' }


and in the news template:
------
{foreach from=$cats item=node}
{if $node.count > 0}

[glow]{if $node.news_category_name|strstr:$param_cat} [/glow]
we have a match <br />
{/if}
------

but my homemade parameter "cat" doesn't seem to be available for use.

Is what I'm trying to achieve possible?

thanks in advance
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by velden »

I quickly looked at the code of news module and then tested it on a website:

cmsms 1.11.7
News 2.12.12

Seems to work like a charm:

Code: Select all

{News action='browsecat' category='testmain*'}
Output:

Code: Select all

    testmain (0)
        testsub1 (0)
        testsub2 (0)
ps. Pretty Urls are on.
yankee80
Forum Members
Forum Members
Posts: 34
Joined: Mon Apr 10, 2006 2:45 am

Re: Bug in News module 2.12.10 (category list can't be filte

Post by yankee80 »

fantastic, it works after upgrading to the latest version!

thanks Velden for testing!
Mich-adg
Forum Members
Forum Members
Posts: 200
Joined: Sat Aug 02, 2008 9:08 pm

Re: Bug in News module 2.12.10 (category list can't be filte

Post by Mich-adg »

Had the same problem after an upgrade to the latest versions (cmsms and news mod). I re-uploaded the news module per ftp and it worked (the upgrade in the back-office wasn't complete, don't know why because i didn't see errors messages...).
Locked

Return to “[locked] Installation, Setup and Upgrade”