[OJS 3.1.2.4] Category pages not ordered by publication date

Hi,
We are running OJS version 3.1.2.4

The category pages that list the published submissions do not seem to be ordering properly. I have selected to order them by publication date (newest first) and see that some new publication dates are actualy at the bottom of the list.

When I select publication date (oldest first) the order seems to be reversed but again not in actual publication date order. So it is ordering in some way it’s just not the publication date. Can you tell me which date it’s actually ordering by?

Thanks
Jeremy

So I think the category list (at /catalog/category/XXXX) sorts by the date_submitted which I believe is generated from the PKPSubmissionListQueryBuilder.inc.php so it’s not a straight forward ‘just change the order by clause’ type of fix.

Here is the fix. for my current version anyway. Just added an elseif statement to the following at:
lib/pkp/classes/services/queryBuilders/PKPSubmissionListQueryBuilder.inc.php

    public function orderBy($column, $direction = 'DESC') {
        if ($column === 'lastModified') {
            $this->orderColumn = 's.last_modified';
        } elseif ($column === 'title') {
            $this->orderColumn = Capsule::raw('COALESCE(submission_tl.setting_value, submission_tpl.setting_value)');
        } elseif($column === 'datePublished'){
            $this->orderColumn = 'ps.date_published';
        }else {
            $this->orderColumn = 's.date_submitted';
        }
        $this->orderDirection = $direction;
        return $this;
    }

Hi @jhennig,

That looks great – could you submit it as a pull request in Github? For OJS 3.1.2-x, it’ll need to go into the stable-3_1_2 branch. Drop a link in the description back to this thread to help keep everything organized. (Let me know if you need some guidance with this!)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher
I just sent the PR. not sure if I formatted it all correctly. But it should work:

Jeremy

1 Like

Thanks, @jhennig! I’ve merged that change.

Regards,
Alec Smecher
Public Knowledge Project Team