Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OJS3] PHP warnings for incompatible function declarations #4672

Closed
MarHerUMR opened this issue Apr 11, 2019 · 7 comments
Closed

[OJS3] PHP warnings for incompatible function declarations #4672

MarHerUMR opened this issue Apr 11, 2019 · 7 comments

Comments

@MarHerUMR
Copy link
Contributor

Since the update to 3.1.2 I got several PHP warnings. I can't really say if this have any consequences for the functionality of OJS but at least it is polluting the log files.

I went through my log files, so here are all the warnings I could find:

Declaration of DRIVERDAO::setOAI(&$oai) should be compatible with PKPOAIDAO::setOAI($oai) in /var/www/ojs/plugins/generic/driver/DRIVERDAO.inc.php on line 19

Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /var/www/ojs/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php

Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /var/www/ojs/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php

Declaration of InstallHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in /var/www/ojs/lib/pkp/pages/install/InstallHandler.inc.php

Declaration of SubmissionFileDAO::fromRow($row) should be compatible with PKPSubmissionFileDAO::fromRow($row, $fileImplementation) in /var/www/ojs/classes/article/SubmissionFileDAO.inc.php

Declaration of ArticleHandler::initialize($request, $args) should be compatible with PKPHandler::initialize($request) in /var/www/ojs/pages/article/ArticleHandler.inc.php

Declaration of SubmissionKeywordEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in /var/www/ojs/lib/pkp/classes/submission/SubmissionKeywordEntryDAO.inc.php

@asmecher
Copy link
Member

@MarHerUMR, we have a long-standing issue with our codebase (which is quite mature) needing adaptation as new releases of PHP become stricter about coding conventions. Previously we had an error handler that discarded many of these warnings (this was necessary because we supported both PHP4 and PHP5, which had incompatible and different conventions) but that has since been removed.

OJS 3.1.2 actually generates far fewer warnings than previous releases -- but there are some. They are cosmetic but you'll need to make sure that you direct errors/warnings to the log rather than the browser (this is recommended for production use of PHP).

Our intention is to fix these gradually in the master branch (and some work has already been done on that). It's probably not useful to have an issue open for it, though, because it's an ongoing cleanup rather than a task anyone is specifically assigned to.

Contributions are welcome on this too :)

@mpbraendle
Copy link
Contributor

Some more that regularly pop up in our log:

PHP Warning: Declaration of RegistrationHandler::validate($request) should be compatible with PKPHandler::validate($requiredContexts = NULL, $request = NULL) in lib/pkp/pages/user/RegistrationHandler.inc.php on line 19

PHP Warning: Declaration of RegistrationForm::validate() should be compatible with Form::validate($callHooks = true) in lib/pkp/classes/user/form/RegistrationForm.inc.php on line 21

PHP Warning: Declaration of JournalOAI::sets($offset, $limit, &$total) should be compatible with OAI::sets($offset, &$total) in classes/oai/ojs/JournalOAI.inc.php on line 22

PHP Warning: Declaration of PiwikSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /usr/local/service/www/ojs/plugins/generic/piwik/PiwikSettingsForm.inc.php on line 0

PHP Warning: Declaration of OJSPermissionSettingsForm::fetch($request, $params = NULL) should be compatible with PermissionSettingsForm::fetch($request, $template = NULL, $display = false, $params = NULL) in controllers/tab/settings/permissions/form/OJSPermissionSettingsForm.inc.php on line 18

PHP Warning: Declaration of SubmissionMetadataViewForm::fetch($request) should be compatible with PKPSubmissionMetadataViewForm::fetch($request, $template = NULL, $display = false) in
controllers/modals/submissionMetadata/form/SubmissionMetadataViewForm.inc.php on line 18

PHP Warning: Declaration of SubmissionSubjectEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in lib/pkp/classes/submission/SubmissionSubjectEntryDAO.inc.php on line 20

PHP Warning: Declaration of SubmissionDisciplineEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in lib/pkp/classes/submission/SubmissionDisciplineEntryDAO.inc.php on line 0

PHP Warning: Declaration of SubmissionAgencyEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in lib/pkp/classes/submission/SubmissionAgencyEntryDAO.inc.php on line 0

PHP Warning: Declaration of SubmissionLanguageEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL) should be compatible with ControlledVocabEntryDAO::getByControlledVocabId($controlledVocabId, $rangeInfo = NULL, $filter = NULL) in lib/pkp/classes/submission/SubmissionLanguageEntryDAO.inc.php on line 0

@asmecher
Copy link
Member

@mpbraendle, what version of OJS are you seeing these with?

@mpbraendle
Copy link
Contributor

Sorry, @asmecher . OJS 3.1.2-1

@asmecher
Copy link
Member

Many of these will already have been fixed in the master branch -- see e.g. 532ae23.

@mpbraendle
Copy link
Contributor

Thanks. Will take those over and apply a patch.

@asmecher
Copy link
Member

Thanks, @mpbraendle! OJS 3.1.2 already complains a lot less than previous releases, and OJS 3.2 will be much better still. Sometime soon I hope to add a no-warning policy on our automated testing set-up so we'll be free and clear of these once and for all (if there ever was such a thing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants