News module not sorting still

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
Jack @ PharSide

News module not sorting still

Post by Jack @ PharSide »

I am running CMSMS 1.2.2 and News 2.6.1 and I am pulling my hair out. I reworked several of the displays of the news system to work as a portfolio manager and everything works perfectly except the news module WILL NOT sort based on anything I ask it too. I have tried everything - probably wasted close to 10 hours trying to figure out what is wrong. Categories seem to sort perfectly - it is only the sortby field that is broken for me. Any ideas why this is happening (or not happening) and is there any fix yet. Is anyone else having this issue? It seems to render the module totally useless as the submission date (default sort) is nothing I can use for these displays.

Thanks and hopefully I can figure something out as I really need these displays to work.

Just in case you want to see it - here is a link to the site's sort problem/page:
http://www.pharside.org/index.php/clients

**Please note the column on the left is having the same problem obviously.
Jack @ PharSide

Re: News module not sorting still

Post by Jack @ PharSide »

I forgot to mention. If you look at my site - it will almost look like it is sorting correctly but it isn't. So far (by chance) I have inputted them close to alphabetical order. However, if you look at Big Toe Audio - it is listed before Bay Area Buy & Sell.

Thanks again for any insight,
-Jack
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: News module not sorting still

Post by calguy1000 »

Posting your news tag here would help.... but we tested the sorting extensively on News 2.6.1 before the release of CMS 1.2.x, so it must be something simple.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Jack @ PharSide

Re: News module not sorting still

Post by Jack @ PharSide »

Oops, I did forget that. Here it is but please note that I stripped everything else out but sortby on several occasions prior to posting in forum. Who knows though - any ideas will be investigated for sure :-)

Code: Select all

{news sortby="news_title" category="Portfolio*" summarytemplate="portfolio" detailtemplate="detailed"}
Jack @ PharSide

Re: News module not sorting still

Post by Jack @ PharSide »

After further testing - I have NO sort capabilities at all. I can't even make sense of the way these items are sorted now. I would guess it is by order submitted - not date. Oh well, guess I will keep plugging away and see if I can fix it. I just don't see anything I can be doing wrong.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12709
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: News module not sorting still

Post by Dr.CSS »

Most times I've found sorting default is by date published, as I've used this to trick it into having newer news post in where I wanted them by giving a diff. publish date...
sep
Forum Members
Forum Members
Posts: 13
Joined: Thu Jun 28, 2007 7:02 am

Re: News module not sorting still

Post by sep »

was any progress made on this? I am having exactly the same issue. sortasc='true' works fine, but sortby doesn't work. What it does do is disable the default sort of news_date and leaves the items unsorted by the look of it - i.e. they just appear in the order they happen to come out of the database. I need to sort by the summary field, and the only way to get items in the correct order is to juggle the date posted fields. This invalidates the date posted and also makes for a lot of work to shift new items into their correct sorted positions. A fix for this would be REALLY welcome!!  ;)
sep
Forum Members
Forum Members
Posts: 13
Joined: Thu Jun 28, 2007 7:02 am

Re: News module not sorting still

Post by sep »

I made the following change and it all came good.
in modules/News/action.default.php around line 131, change this line:

Code: Select all

$query1 .= "ORDER BY '" . str_replace("'", '', str_replace(';', '', $params['sortby'])) . "' ";
to this:

Code: Select all

$query1 .= "ORDER BY " . str_replace("'", '', str_replace(';', '', $params['sortby'])) . " ";
Hope that helps
Locked

Return to “Modules/Add-Ons”