HP Forums
Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Forum Issues and Administration (/forum-19.html)
+--- Thread: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] (/thread-7636.html)



Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - chromos - 01-21-2017 01:18 PM

[MOVED FROM THE HP PRIME SOFTWARE LIBRARY - katie]

I'm unable to sort posts in this section of forum (as it works elsewhere).

I want to sort posts as:

Sort by: Last Post
Order: Descending
From: The Beginning

If I choose these in dropboxes at bottom of the page and click Go then it works. Then I click on Next button (or any page number) then Order reverts to Ascending.

Anybody else is seeing the same behaviour?
[Firefox 50.1.0]

[attachment=4396] [attachment=4397]


RE: Sorting posts in this section of forum is broken (?) - Katie Wasserman - 01-21-2017 03:28 PM

I agree it's broken. Furthermore it's broken in at least one other sub-forum in the HP Software Libraries area but it works correctly on the main forum, for example.

Dave, this is pretty weird. Is there some sort of setting that needs to be applied to all forums that's only applied to some of them?


RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Dave Hicks - 01-21-2017 05:41 PM

Honestly, I'm not sure what setting I would be looking for. My guess would be bug of some sort. If there was a list of forums that behave correctly and incorrectly I could look for any settings differences that the groups might have in common.


RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Han - 02-13-2017 03:43 PM

(01-21-2017 05:41 PM)Dave Hicks Wrote:  Honestly, I'm not sure what setting I would be looking for. My guess would be bug of some sort. If there was a list of forums that behave correctly and incorrectly I could look for any settings differences that the groups might have in common.

Whatever generates the links for the pages does not include the sort order in the link. After sorting in descending order, for example, hover your mouse over link for page 2 at the bottom. I see:

Code:
http://www.hpmuseum.org/forum/forum-15-page-2.html?sortby=views&datecut=9999

The sortby=views should be sortby=views&order=desc.


RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Han - 02-13-2017 05:29 PM

In the file forumdisplay.php at line 697 is the following code:

Code:
    if($sortordernow != "desc")
    {
        $page_url .= "{$q}{$and}order={$sortordernow}";
        $q = '';
        $and = "&";
    }

The problem is that the default sort is ascending (for software libraries) as set by the administrator for this particular forum. However, the code is programmed to assume that the default mode is always descending, so that URLs with a descending sort (as selected by readers) do not have order=desc added to them. But when the URL is processed and since the default behavior for non-explicit sort order is to use ascended sort (set by the administrator), the user never gets the descended sort.

Therein lies the problem -- the admin-selected default is 'asc' whereas the assumed default is 'desc'.

I am sure that by simply removing the test and making the sort order always explicit we will solve this issue. I would change the above to:

Code:
        $page_url .= "{$q}{$and}order={$sortordernow}";
        $q = '';
        $and = "&";

(remove the surrounding brackets and if statement)


RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Han - 02-25-2017 03:26 PM

So is there any chance we can try out this fix?


RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Dave Hicks - 02-27-2017 01:01 AM

It could be tried at some point but I'm currently pretty busy. At least I'm back home now, but coming home seems to lead to more things to get done by yesterday.