Matomo plugin settings inaccessible in 3.3.0.19 after upgrading PHP to 8.0.30

Describe the issue or problem
We use the Matomo plugin for several journals on our multi-journal installation. After upgrading PHP from 7.4.33 to 8.0.30, we can no longer access the settings for the plugin.

Steps I took leading up to the issue

  1. Go to Matomo plugin under Installed plugins.
  2. Click on Settings.
  3. The system throws this error: Failed Ajax request or invalid JSON returned.
  4. The plugin appears to be working for journals that previously had it enabled (before we upgraded PHP), but since we cannot access the settings, we can’t properly enable it for new journals.

In our test installation, we tried downgrading to PHP 7.4.33 and the plugin’s settings were then accessible again.

What application are you using?
OJS 3.3.0-19
PHP 8.0.30

Additional information
This is an excerpt from the PHP logs that our IT dept. thought might be relevant:

[03-Dec-2024 14:02:35 Europe/Stockholm] PHP Warning:  Declaration of PiwikSettingsForm::fetch($request) should be compatible with Form::fetch($request, $template = NULL, $display = false) in /var/www/html/ojs/plugins/generic/piwik/PiwikSettingsForm.inc.php on line 65
[03-Dec-2024 14:02:35 Europe/Stockholm] PHP Warning:  Declaration of PiwikSettingsForm::execute() should be compatible with Form::execute(...$functionArgs) in /var/www/html/ojs/plugins/generic/piwik/PiwikSettingsForm.inc.php on line 74

Hi @Ramfra,

Thanks for reporting this - I’ve filed this issue here and will get this fixed for an updated 3.3 release soon: Piwik/Matomo plugin missing function parameters · Issue #10657 · pkp/pkp-lib · GitHub


Kaitlin Newson
PKP Team

Hi @Ramfra,

We have a new release available now for the Matomo plugin in the plugin gallery that should resolve this for you - can you try updating the plugin (in Settings > Website > Plugins > Plugin Gallery) and see if things work for you now in PHP 8?


Kaitlin Newson
PKP Team

Hi @kaitlin,

Thank you so much for the quick work on this! We updated the plugin via the plugin gallery but are still getting the same error when we try to access the settings.

The PHP logs show the following:

[12-Dec-2024 15:37:22 Europe/Stockholm] PHP Fatal error:  Declaration of PiwikSettingsForm::fetch($request) must be compatible with Form::fetch($request, $template = null, $display = false) in /var/www/html/ojs/plugins/generic/piwik/PiwikSettingsForm.inc.php on line 65

Is there something else we should try?

Best,
Ramana

Hi @Ramfra, apologies for the delay. Can you confirm you have the correct version of the plugin installed? One way to check is your database versions table, e.g. with the following query:

SELECT * FROM versions WHERE product = 'piwik';

We’re looking for version 1.0.4-1 to be installed for this fix.

Hi @kaitlin,
Thanks for following up on this. We are not actually able to install the correct version of the plugin because we had previously installed 1.0.5-0 and now it won’t allow us to downgrade. This is the message we get:

Europe/Stockholm] ojs2: You are trying to downgrade the product "piwik" from version [1.0.5.0] to version [1.0.4.1]. Downgrades are not supported.```

We tried completely deleting the plugin and reinstalling, but we get the same error. Do you have any tips or tricks for how to get around this?

Hi @Ramfra, along with deleting the plugin files, you will also need to delete the row for version 1.0.5 from the versions table in the database (that plugin version is for OJS 3.4). Then you should be able to install the correct version.

I’d also recommend always installing plugins through the plugin gallery when possible to ensure you get the correct version of a plugin for your software version.

Hi @kaitlin,
Thanks for the additional instructions (and recommendation). Once we deleted the rows from the versions table, we could reinstall Matomo from the plugin gallery, and the changes to the plugin worked - that is, we now have access to settings again. Many thanks!

1 Like