@ms502040 opened this Issue on December 5th 2020

ERROR [2020-12-01 18:52:03] 22241 Uncaught exception: ArgumentCountError: mysqli_stmt::bind_param() does not accept unknown named parameters in libs/Zend/Db/Statement/Mysqli.php:203
Stack trace:
#0 libs/Zend/Db/Statement/Mysqli.php(203): mysqli_stmt->bind_param('ssssssss', idarchive: 403, name: 'done', report: NULL, idsite: 19, date1: '2020-12-01 00:0...', date2: '2020-12-01 00:0...', period: 1, ts_invalidated: '2020-12-01 18:5...')

PHP 8.0.0
Matomo v. 4.0.0 - current

file: libs/Zend/Db/Statement/Mysqli.php
line: 199
$stmtParams[$k] = &$value;
must be:
$stmtParams[] = &$params[$k];

@tsteur commented on December 6th 2020 Member

Hi @ms502040
are you using Matomo On-Premise or Matomo for WordPress?

Could you maybe try to upgrade to Matomo 4.0.4 and see if it's fixed there maybe?

@tsteur commented on December 6th 2020 Member

I just ran the invalidator and dataccess/model tests with mysqli and PHP8 and they worked for me. The only thing that I noticed was warnings in the tests itself like

Piwik\Tests\Integration\DataAccess\ArchiveInvalidatorTest::test_markArchivesAsInvalidated_DoesNotInvalidateDatesBeforePurgeThreshold
reset(): Argument <a href='/1'>#1</a> ($array) must be passed by reference, value given

/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php:1509
/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php:488

Possible though there's an issue somewhere else

@tsteur commented on December 6th 2020 Member

I can reproduce this now:

piwik/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php:1245

23) Piwik\Tests\Integration\DataAccess\ArchiveInvalidatorTest::test_reArchiveReport_createsCorrectInvalidationEntries_ifReportSpecified
ArgumentCountError: mysqli_stmt::bind_param() does not accept unknown named parameters

piwik/libs/Zend/Db/Statement/Mysqli.php:203
piwik/libs/Zend/Db/Statement.php:300
piwik/libs/Zend/Db/Adapter/Abstract.php:479
piwik/core/Db.php:276
piwik/core/Db/BatchInsert.php:41
piwik/core/Db/BatchInsert.php:133
piwik/core/DataAccess/Model.php:243
piwik/core/Archive/ArchiveInvalidator.php:690
piwik/core/Archive/ArchiveInvalidator.php:329
piwik/core/Archive/ArchiveInvalidator.php:503
piwik/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php:1301

24) Piwik\Tests\Integration\DataAccess\ArchiveInvalidatorTest::test_reArchive_acceptsCustomStartDate
ArgumentCountError: mysqli_stmt::bind_param() does not accept unknown named parameters

piwik/libs/Zend/Db/Statement/Mysqli.php:203
piwik/libs/Zend/Db/Statement.php:300
piwik/libs/Zend/Db/Adapter/Abstract.php:479
piwik/core/Db.php:276
piwik/core/Db/BatchInsert.php:41
piwik/core/Db/BatchInsert.php:133
piwik/core/DataAccess/Model.php:243
piwik/core/Archive/ArchiveInvalidator.php:690
piwik/core/Archive/ArchiveInvalidator.php:329
piwik/core/Archive/ArchiveInvalidator.php:503
piwik/tests/PHPUnit/Integration/DataAccess/ArchiveInvalidatorTest.php:1359
@sgiehl commented on December 6th 2020 Member

@tsteur should we maybe run the AllTests on PHP 8 instead of 7.4 to be sure everything works with PHP 8 in the future?

@tsteur commented on December 6th 2020 Member

@sgiehl depends. how much work is it?

@sgiehl commented on December 6th 2020 Member

how much work is it?

might be easy. will check tomorrow if it's enough to simply replace the version number in .travis.yml or if it would require some additional work

This Issue was closed on December 6th 2020
Powered by GitHub Issue Mirror