Database error When sorting with Status in section editor page

Hi Team,

On the section editor page, in the archives section, when I try to sort the list by “Status” (the right-most column), I get the following database error:

DB Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ASC LIMIT 0,50’ at line 38.

Please suggest

Hi @bala_subrahmanyam,

What version of OJS are you using?

Regards,
Alec Smecher
Public Knowledge Project Team

HI Alec,

I’m using OJS 2.4.5, but upgraded to 2.4.6 via patch file.

Hi @bala_subrahmanyam,

Could you turn on the show_stacktrace option in config.inc.php, try again, and post the full stack trace here?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

Below are the stackTrace Details

Stack Trace:
File: C:\xampp\htdocs\ojs\ojs\classes\submission\sectionEditor\SectionEditorSubmissionDAO.inc.php line 484
Function: DAO->retrieveRange(“SELECT DISTINCT a.*, scf.date_completed as copyedit_comp…”, Array(22), Object(DBResultRange))

File: C:\xampp\htdocs\ojs\ojs\classes\submission\sectionEditor\SectionEditorSubmissionDAO.inc.php line 579
Function: SectionEditorSubmissionDAO->_getUnfilteredSectionEditorSubmissions(“37”, “1”, 0, “3”, “contains”, “”, “4”, Null, Null, “a.status <> 1”, Object(DBResultRange), “status”, “1”)

File: C:\xampp\htdocs\ojs\ojs\pages\sectionEditor\SectionEditorHandler.inc.php line 122
Function: SectionEditorSubmissionDAO->getSectionEditorSubmissionsArchives(“37”, “1”, 0, “3”, “contains”, “”, “4”, Null, Null, Object(DBResultRange), “status”, “1”)

File: (unknown) line (unknown)
Function: SectionEditorHandler->index(Array(1), Object(Request))

File: C:\xampp\htdocs\ojs\ojs\lib\pkp\classes\core\PKPRouter.inc.php line 362
Function: call_user_func(Array(2), Array(1), Object(Request))

File: C:\xampp\htdocs\ojs\ojs\lib\pkp\classes\core\PKPPageRouter.inc.php line 220
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(1), False)

File: C:\xampp\htdocs\ojs\ojs\lib\pkp\classes\core\Dispatcher.inc.php line 134
Function: PKPPageRouter->route(Object(Request))

File: C:\xampp\htdocs\ojs\ojs\lib\pkp\classes\core\PKPApplication.inc.php line 178
Function: Dispatcher->dispatch(Object(Request))

File: C:\xampp\htdocs\ojs\ojs\index.php line 64
Function: PKPApplication->execute()

Hi @bala_subrahmanyam,

Thanks for the details – I’ve replicated the problem locally, and filed a bug entry here:

Watch for a fix to show up at that link.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you Alec, Sure

Hi @bala_subrahmanyam,

This ended up being a 1-line change. Could you make the modification to your system (from the above link) and report whether it corrects the problem for you? If so, I’ll commit it to our github repository for release in the next version of OJS.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you Alec,

added “case ‘status’: return ‘a.status’;” line @\classes\submission\sectionEditor\SectionEditorSubmissionDAO.inc.php file

it worked …!!! :smiley:

Hi @bala_subrahmanyam,

Thanks – I’ve committed this for release in the next OJS package.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello, our journal is hosted by the U of A Libraries, they have OJS 2.4.8.1 (OJS 3 coming soon, I am told, but probably at least 1 issue away, if not 2)

When I sort on Status under Editor > Submissions > Archives, there is no error message, but the entries are not sorted properly, i.e., some of it appears to be consistent, but only in chunks. Here are the first few entries on the first page (reverse sort), as an example (status being the last column, i.e., published volume data):

22356 2014-07-13 ART Laplante, Fostik DISENTANGLING THE QUEBEC FERTILITY PARADOX: THE RECENT… Vol 42, No 1-2 (2015): Spring/Summer

21636 2014-03-19 ART Heintz-Martin, Le Bourdais, Hamplová CHILDBEARING AMONG CANADIAN STEPFAMILIES Vol 41, No 1-2 (2014): Spring/Summer

16013 2012-01-19 ART Xu, Gauthier, Strohschein WHY ARE SOME CHILDREN LEFT OUT? FACTORS BARRING CANADIAN… Vol:36 No.3-4 (2009)

15872 2012-01-19 ART Burch LONGITUDINAL RESEARCH IN SOCIAL SCIENCE: SOME THEORETICAL… Vol:28 No.2 (2001)

15873 2012-01-19 ART Laplante, Hébert AN INTRODUCTION TO THE USE OF LINEAR MODELS WITH… Vol:28 No.2 (2001)

Now I know they have been entered inconsistently, but even within that, the sort does not seem to be working.

I need to generate a list of reviewers for each volume (2 issues in a calendar year), but the “Articles” stats do not include reviewers or published volume info, and the “Reviews” stats do not include published volume info, either. So I want to be able to produce a list of (article submission numbers + reviewers) associated with a particular published volume – ideally with reviewer affiliation too :slight_smile:

Any help with that would be much appreciated.
Thanks,
Ksenia
CSP Journal Manager

Hi @cspeditr,

Could you post that as a new thread? That’ll help to keep the forum organized. This is a different issue, and the thread has been dead for a year.

Regards,
Alec Smecher
Public Knowledge Project Team