Descending order in the Archives page

Hello,
We have many thousands of articles in the archive and it would be a great help to order them descending by default.
I tried EditorSubmissionDAO.inc.php and changed $sortDirection in the input parameters of these two functions, but it did not work:
function &getEditorSubmissionsArchives($journalId, $sectionId, $editorId, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_DESC) {....}
and

function &_getUnfilteredEditorSubmissions($journalId, $sectionId = 0, $editorId = 0, $searchField = null, $searchMatch = null, $search = null, $dateField = null, $dateFrom = null, $dateTo = null, $additionalWhereSql, $rangeInfo = null, $sortBy = null, $sortDirection = SORT_DIRECTION_DESC) {....}

If I change $sortDirection inside the functions, the articles will be sorted desccending, but the sorting behaviour of the grid will not work anymore.
Could you help me on this topic?
We are on OJS-2.4.6

Best,
Ali

The default view of the archives is handled by journalName/editor/submissions/submissionsArchives, so look for the page handler in pages/editor. “submissions” is handled by pages.editor.EditorHandler:

The function submissions handles the default sort here:

Note that multiple submissions page displays are handled here, not just the archives:

If you don’t want the default sort to change for Unassigned, InReview, InEditing, etc., you will need to provide a conditional for your change.

1 Like

Thankyou @ctgraham,
problem solved.

Hello,

Any pointers on where I could find this for OJS 3?

Thank you!

@ctgraham I found it, in case anybody else is interested, the relevant file is lib/pkp/classes/submission/SubmissionDAO.inc.php

I changed all the queries mentioned in this patch pkp/pkp-lib#2270 Sort submission lists by ID · pkp/pkp-lib@e2e1a0c · GitHub but instead of inserting the patch sorting option

. ' ORDER BY s.submission_id',

I put

. ' ORDER BY ps.date_published DESC',

Now my Archives page starts with the latest articles first. Thank you!

Edit: this was done on OJS 3.0.0

3 Likes