pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
304 stars 444 forks source link

OJS: PHP Fatal error: Declaration of SubmissionChecklistForm::initData($args) must be compatible with Form::initData() #7820

Closed hktang closed 2 years ago

hktang commented 2 years ago

Describe the bug

Hi, I tried to install OJS using the Git repository. The installation went well, but when it comes to setting up the checklist in the journal, I always receive the message "Failed Ajax request or invalid JSON returned.".

On the server side, I got this fatal error:

[proxy_fcgi:error] [pid 5084:tid 139729110562560] [client omitted] AH01071: Got error 'PHP message: PHP Fatal error:  Declaration of SubmissionChecklistForm::initData($args) must be compatible with Form::initData() in /var/www/ojs/ojs/lib/pkp/controllers/grid/settings/submissionChecklist/form/SubmissionChecklistForm.inc.php on line 41', referer: https://domain.omitted/index.php/bulletin/management/settings/workflow

The browser developer tool shows 500 error:

/index.php/bulletin/$$$call$$$/grid/settings/submission-checklist/submission-checklist-grid/add-item

I tried both the latest commit and the 3.3.0.10 version, and encountered same error on both.

To Reproduce

Steps to reproduce the behaviour:

  1. Install software with success.
  2. Create journal.
  3. Visit Workflow -> Submission -> Checklist and click Add item
  4. See error:

Screenshot 2022-04-04 145745

What application are you using?

OJS, version 3.4.0 and 3.3.0.10

Additional information

I have searched through the community forum and read a couple of threads with similar errors. However, none of them seem to be relevant. Thank you in advance for taking a look!

asmecher commented 2 years ago

@hktang, it seems like recent releases of PHP 8.x have suddenly gotten stricter about this aspect. https://github.com/pkp/pkp-lib/commit/8dc4fde42cbdeec91460e16cb8a6c42340a9c4c1 (applied in lib/pkp) should fix this for you.

hktang commented 2 years ago

Thank you for the fix! I confirm it works as expected now.

asmecher commented 2 years ago

:+1: Thanks for confirming!