DB Error: FUNCTION db.DATE_PART does not exist


#1

Hello, I am facing a problem hours before to go to production.

I have 3 environments, In my production site (Window server 2012) the OJS version Versión actual: 3.1.1.2 is unable to load reviewers in the review stage.

Everything else works perfectly fine.

I got this message :

Inspecting the element I found a clean console, and even a 200 Ok to a get method into this route:

http://path-to-the-site/$$$call$$$/grid/users/reviewer/reviewer-grid/show-reviewer-form?submissionId=2358&stageId=3&reviewRoundId=53&selectionType=1&_=1547132811937

On the network panel, the response is empty, but if I try to access into that route I found this error:

DB Error: FUNCTION mine_dataBase.DATE_PART does not exist

There is not a single line with .DATE_PART function!

Checking my phperror.log I just found the same message:

[10-Jan-2019 16:10:03 Europe/Berlin] PHP Warning:  Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in C:\xampp\htdocs\CEDEX\lib\pkp\plugins\generic\usageEvent\PKPUsageEventPlugin.inc.php on line 386
[10-Jan-2019 16:10:03 Europe/Berlin] PHP Warning:  Declaration of ReviewerForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in C:\xampp\htdocs\CEDEX\lib\pkp\controllers\grid\users\reviewer\form\ReviewerForm.inc.php on line 19
[10-Jan-2019 16:10:03 Europe/Berlin] PHP Warning:  Declaration of ReviewerForm::initData($args, $request) should be compatible with Form::initData() in C:\xampp\htdocs\CEDEX\lib\pkp\controllers\grid\users\reviewer\form\ReviewerForm.inc.php on line 19
[10-Jan-2019 16:10:03 Europe/Berlin] PHP Warning:  Declaration of ReviewerForm::execute($args, $request) should be compatible with Form::execute() in C:\xampp\htdocs\CEDEX\lib\pkp\controllers\grid\users\reviewer\form\ReviewerForm.inc.php on line 19
[10-Jan-2019 16:10:04 Europe/Berlin] ojs2: DB Error: FUNCTION cedex_sept.DATE_PART does not exist

I am working with the xampp control panel V3.2.2.

The same configuration for my machine, the local environment. But here, it works!!.

The code is the same in both places, I am working with git!

I thought it was for different databases, but I exported the database from the production into my local environment and still working!!. No idea why the database is “fine” I guess. . .

I dont know what to do with this problem, I cant find the cause.

the list of reviewer is fine:


#2

Hi there,

the database function, DATE_PART, is only used in a single part of the entire OJS code base. It’s used in:

./lib/pkp/classes/services/queryBuilders/UserListQueryBuilder.inc.php

and is the default method of building a date clause if you are not using either the mysql or mysqli database driver in your config.inc.php file. Are you sure your drivers are the same between production and test?

Cheers,
Jason


#3

oh nice clue!.

In fact the config.inc.php file is not in the git repository. I will check it tomorrow, thanks you!