Custom Header Plugin - Failed AJAX Request after upgrade to 3.3.0.7

Description of issue or problem I’m having:
I have recently upgraded OJS to 3.3.0.7 and I want to put some code in my header, so I tried using Custom Header Plugin but when I try to SETTING button it returned the following pop up error of Failed Ajax request or invalid JSON returned.

In PHP Error Log:
[12-Sep-2021 06:30:59 UTC] PHP Fatal error: Declaration of CustomHeaderSettingsForm::execute($request, …$functionArgs) must be compatible with Form::execute(…$functionArgs) in /home/USER/public_html/JOURNALFOLDER/plugins/generic/customHeader/CustomHeaderSettingsForm.inc.php on line 71

So please help me to fix the issue or inform about any way how do I add code in header of each page in OJS.
Steps I took leading up to the issue:

I couldn’t find any resolution in forum. So I tried downloading the plugin, delete and reinstall, upgrade etc. But nothing worked.

What I tried to resolve the issue:

Application Version - e.g., OJS 3.1.2:

Additional information, such as screenshots and error log messages if applicable:
image

I got same issue on las release (3.3.0-10) with php8.

PHP Fatal error: Declaration of CustomHeaderSettingsForm::execute($request, ...$functionArgs) must be compatible with Form::execute(...$functionArgs) in /var/www/html/plugins/generic/customHeader/CustomHeaderSettingsForm.inc.php on line 71

Changing the function declaration from:

function execute($request, ...$functionArgs) {
to:
function execute(...$functionArgs) {

Let you pass the initial error but then you can not submit the form (because $request var is missing).

@asmecher do you remember if the plugin is ready for 3.3?
Sould automatic tests throw a red light in this cases?

Cheers,
m.

Hi all,

See: Fatal error with (some versions of) PHP8 on CustomHeaderSettingsForm::execute · Issue #21 · pkp/customHeader · GitHub

I haven’t released a new package of the custom header plugin since that issue was resolved, so you’ll need to either apply the change yourself or move to an older version of PHP. It seems that only some releases of PHP 8.0 take issue with formulations of this kind.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like