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
Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in app/plugins/Diagnostics/Diagnostic/PhpVersionCheck.php on line 66 #19352
Comments
another related warning Deprecated: version_compare(): Passing null to parameter #1 ($version1) of type string is deprecated in app/core/CliMulti/CliPhp.php on line 76 |
@mattmary I'm not seeing this error when using Matomo the "normal" way on PHP 8.1. |
@sgiehl when you say the normal way is matomo on premise? |
Yes. On premise |
in php8.1 @sgiehl ? |
tested it with 8.1.5 |
hi @sgiehl I've tried different ways to fix this issue. the only one which work is to define as global the variable $piwik_minimumPHPVersion in this file. which impact would it have to do so? |
That variable actually should be global. But maybe that isn't the case as WordPress includes Matomo 🤔 |
@justinvelluppillai I don't have Matomo for Wordpress set up, so I'm not able to say if there would a smarter solution. But adding a global keyword should not produce any problems I guess. |
@mattmary Is this something we still need to change in core, or is the fix for wordpress a suitable solution and we can close this one? |
@sgiehl Sure I can fix it, but I'll have to do it each time we publish a new release. It would be definitively better if you could update the core. |
@mattmary Would you mind creating a pull request for core? |
Hum @sgiehl Now with the latest branch release, I've some fatal errors: So I would suggest postponing this fix in the release after the 4.13. |
there is a deprecated warning on php8.1 for a variable is null and should be a string
Expected Behavior
No warning displayed when displaying the system report page within the wordpress plugin.
Current Behavior
A warning is displayed when running with php8.1 the system report page
Possible Solution
define the $piwik_minimumPHPVersion variable as global in the app/core/testMinimumPhpVersion.php solves this issue.
Steps to Reproduce (for Bugs)
1.install the wordpress plugin
2.switch to php8.1 version for your apache
3.open the wp-admin/admin.php?page=matomo-systemreport url
4.views the warning
5.add global $piwik_minimumPHPVersion; in line 25 of the app/core/testMinimumPhpVersion.php
6. refresh the page
7. see the warning message has disappeared
Context
Your Environment
The text was updated successfully, but these errors were encountered: