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

Make Matomo compatible with PHP 7.4 #14821

Closed
Findus23 opened this issue Aug 27, 2019 · 9 comments · Fixed by #15180
Closed

Make Matomo compatible with PHP 7.4 #14821

Findus23 opened this issue Aug 27, 2019 · 9 comments · Fixed by #15180
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@Findus23
Copy link
Member

Findus23 commented Aug 27, 2019

similar to #13418

Status:

All Warnings in Matomo itself and the broken Twig rendering are fixed in Matomo 3.12. All remaining warnings depend on third-party libraries (see below).

Soon PHP 7.4 will be released (RC 1 is planned or September 5th), so it would be great if Matomo would work mostly fine when it is released.

I set up a Matomo instance using the latest beta4 at https://matomo-beta.lw1.at
If you want to get access, just message me.

Current status is that Matomo is nearly completly unusable as it renders invalid HTML with missing whitespaces:

<ul class="right hide-on-med-and-down"><li role="menuitem" class="active"><atitle="Zeige Webanalytik Berichte für Testsite."                  id="topmenu-corehome"
                  href="index.php?module=CoreHome&amp;action=index&amp;idSite=1&amp;period=day&amp;date=yesterday"               target="_self" tabindex="3">Dashboard</a></li><li role="menuitem" class=""><atitle="Vergleichen Sie Webanalytikstatistiken für alle Ihre Websites."                  id="topmenu-multisites"
                  href="index.php?module=MultiSites&amp;action=index&amp;idSite=1&amp;period=day&amp;date=yesterday"               target="_self" tabindex="3">Alle Websites</a></li><li role="menuitem" class=""><atitle=""                  id="topmenu-tagmanager"

This seem to be caused by a required change in Twig (twigphp/Twig@1fb0f97), so updating to twig 1.41.0 or later should solve this.

@Findus23 Findus23 added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Aug 27, 2019
@Findus23
Copy link
Member Author

Findus23 commented Aug 28, 2019

One more bug that breaks archiving: (appears as a response in archiving)

PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/matomo-beta/libs/upgradephp/upgrade.php on line 180 PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/matomo-beta/libs/upgradephp/upgrade.php on line 194 PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/matomo-beta/libs/upgradephp/upgrade.php on line 194 PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/matomo-beta/libs/upgradephp/upgrade.php on line 200 PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/matomo-beta/libs/upgradephp/upgrade.php on line 202 

if ($line{0} == '[') {

I don't know what that line means, but I am also confused why this function is here when Matomo is using a custom ini parser.

Update: It seems to just be a weird way of writing if ($line[0] == '[') {

@Findus23
Copy link
Member Author

One more warning in the log:

/var/www/matomo-beta/core/DataTable/Filter/ColumnDelete.php(164): Deprecated - array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead - Matomo 3.11.0

if (!array_key_exists($column, $row)) {

@Findus23
Copy link
Member Author

Findus23 commented Aug 28, 2019

Another occurrence of the braces will be fixed with leafo/lessphp#647 (if it gets merged as the last release was 5 years ago)

Update: This one is going to be fun to fix as the latest lessphp requires PHP 5.6+: leafo/lessphp@18b8f29

@Findus23
Copy link
Member Author

Two more deprecation warnings in tcpdf will be fixed with
tecnickcom/TCPDF#123
and
tecnickcom/TCPDF#131

@Findus23
Copy link
Member Author

Another potential bug (but I don't think it happens in Matomo and is only very minor):
davaxi/Sparkline#10

@mattab
Copy link
Member

mattab commented Oct 27, 2019

@Findus23 Thanks for creating the issue! 👍 What is the status of PHP 7.4 compatibility now?

@Findus23
Copy link
Member Author

@mattab I think all remaining issues are in third party libraries as mentioned above. And Matomo won't be completly ususable as of now.
But I don't have a great solution for updating those.

@diosmosis
Copy link
Member

Looks like the only package that needs to be updated is lessphp, but that does not have a release w/ the fix. I suppose we could fork it as well or wait until matomo 4.

@tsteur
Copy link
Member

tsteur commented Nov 19, 2019

We'd need to fork it in this case since we can't wait to Matomo 4 unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants