Searching by submisison id in 2.4.8-2

On the editors’ home page there is an option for searching by submission_id. Searching with “is” works fine, but searching with “starts with” or “contains” causes a bad crash as below.

Note that we are using Postgres 8.4.20, which is supposed to be sufficient for 2.4.8-2. However, this page says that the CONCAT function appeared in Postgres 9.1.

Cheers, Brendan.

DB Error: ERROR: function concat(integer) does not exist LINE 39: AND a.submission_progress = 0 AND CONCAT(a.article_id) ... ^ 

HINT: No function matches the given name and argument types. You might need to add explicit type casts.
Stack Trace:
File: DIR/classes/submission/editor/EditorSubmissionDAO.inc.php line 356
Function: DAO->retrieveRange(“SELECT DISTINCT a.*, scf.date_completed as copyedit_comp…”, Array(22), Object(DBResultRange))

File: DIR/pages/editor/EditorHandler.inc.php line 128
Function: EditorSubmissionDAO->_getUnfilteredEditorSubmissions(“1”, Null, 0, “8”, “contains”, “123”, “4”, Null, Null, Null, Object(DBResultRange), “id”, 1)

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

File: DIR/lib/pkp/classes/core/PKPRouter.inc.php line 362
Function: call_user_func(Array(2), Array(1), Object(Request))

File: DIR/lib/pkp/classes/core/PKPPageRouter.inc.php line 220
Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(1), False)

File: DIR/lib/pkp/classes/core/Dispatcher.inc.php line 134
Function: PKPPageRouter->route(Object(Request))

File: DIR/lib/pkp/classes/core/PKPApplication.inc.php line 178
Function: Dispatcher->dispatch(Object(Request))

File: DIR/index.php line 64
Function: PKPApplication->execute()

Hi @bdm,

Try applying the following patch: Test char cast fix for ID searches/PostgreSQL type mismatch · asmecher/ojs@79c404a · GitHub

Please confirm whether it resolves the issue, and if so, I’ll commit it to the distribution.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

This change eliminates the crash, but the behaviour after the change is
not expected.
Searching for a single character X finds all submission ids starting
with X regardless
of whether “starts with” or “contains” is selected. Searching for more
than one
character produces an empty result for both “starts with” or “contains”.

Actually I don’t see why an editor would ever want to search for, say,
all submission
ids that “contain 12”. It seems useless, though “is 12” is extremely
useful. I propose
that in the case of submission ids both “starts with” or “contains”
behave the same as “is”
so that editors can just ignore the choice.

Thanks, Brendan.

Hi @bdm,

That’s a refinement we’ll probably never get around to in OJS 2.x – the submission lists are much improved in OJS 3.x and don’t use the same SQL structures. I’d suggest sticking with the change posted above, but do consider moving to OJS 3.x when you’re ready.

Regards,
Alec Smecher
Public Knowledge Project Team