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

named parameters in mysqli_stmt->bind_param #16885

Closed
ms502040 opened this issue Dec 5, 2020 · 6 comments · Fixed by #16893
Closed

named parameters in mysqli_stmt->bind_param #16885

ms502040 opened this issue Dec 5, 2020 · 6 comments · Fixed by #16893
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@ms502040
Copy link

ms502040 commented Dec 5, 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 tsteur added this to the 4.0.3 milestone Dec 6, 2020
@tsteur tsteur added the Can't reproduce (yet) For issues that are reported by several people, but can't be reproduced reliably and need more data label Dec 6, 2020
@tsteur
Copy link
Member

tsteur commented Dec 6, 2020

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 tsteur added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed Can't reproduce (yet) For issues that are reported by several people, but can't be reproduced reliably and need more data labels Dec 6, 2020
@tsteur
Copy link
Member

tsteur commented Dec 6, 2020

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 #1 ($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 tsteur added Bug For errors / faults / flaws / inconsistencies etc. and removed Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. labels Dec 6, 2020
@tsteur
Copy link
Member

tsteur commented Dec 6, 2020

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
Copy link
Member

sgiehl commented Dec 6, 2020

@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
Copy link
Member

tsteur commented Dec 6, 2020

@sgiehl depends. how much work is it?

@sgiehl
Copy link
Member

sgiehl commented Dec 6, 2020

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

diosmosis pushed a commit that referenced this issue Dec 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
3 participants