@tsteur opened this Issue on January 31st 2022 Member

Can be reproduced on the demo: https://demo.matomo.cloud/?module=API&method=Live.getVisitorProfile&idSite=1&format=JSON&limitVisits=all and also locally getting an error there.

PHP 8.0.

see https://github.com/matomo-org/matomo/blob/4.7.0-rc2/plugins/Live/VisitorDetails.php#L218 we might need to double check that a row is actually there.

Error: {"message":"Call to a member function getColumn() on bool","file":"\/plugins\/Live\/VisitorDetails.php","line":218,"request_id":"0950d","backtrace":" on \/plugins\/Live\/VisitorDetails.php(218)\n#0 \/plugins\/Live\/VisitorProfile.php(67): Piwik\Plugins\Live\VisitorDetails->finalizeProfile(Object(Piwik\DataTable), Array)\n#1 \/plugins\/Live\/API.php(228): Piwik\Plugins\Live\VisitorProfile->makeVisitorProfile(Object(Piwik\DataTable), 'a687a3d0666fa4f...', false, 0)\n#2 [internal function]: Piwik\Plugins\Live\API->getVisitorProfile('1', 'a687a3d0666fa4f...', false, 0)\n#3 \/core\/API\/Proxy.php(244): call_user_func_array(Array, Array)\n#4 \/core\/Context.php(28): Piwik\API\Proxy-

@sgiehl commented on February 1st 2022 Member

@tsteur the problem actually is that all is not supported for limitVisits. The code that behaves differently on PHP 7 vs PHP 8 is this part:
https://github.com/matomo-org/matomo/blob/0e910f0badf1aaa6e1b34b83f4f1f9a11bd5b373/plugins/Live/API.php#L207-L211

'all' <= 0 is true on PHP 7, while it is false on PHP 8

I'll prepare a PR to fix the handling of invalid values.

@tsteur commented on February 1st 2022 Member

👍

This Issue was closed on February 4th 2022
Powered by GitHub Issue Mirror