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

AbstractDeviceParser::getShortCode() must be of the type string, int returned #16889

Closed
gusevmaksim opened this issue Dec 5, 2020 · 3 comments · Fixed by #16900
Closed

AbstractDeviceParser::getShortCode() must be of the type string, int returned #16889

gusevmaksim opened this issue Dec 5, 2020 · 3 comments · Fixed by #16900
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@gusevmaksim
Copy link

Matomo 4.0.4
./console queuedtracking:process
vendor/matomo/device-detector/Parser/Device/AbstractDeviceParser.php line 924:
Return value of DeviceDetector\Parser\Device\AbstractDeviceParser::getShortCode() must be of the type string, int returned

version to
return (string) \array_search($brand, self::$deviceBrands) ?: '';

@Findus23 Findus23 changed the title queuedtracking redis AbstractDeviceParser::getShortCode() must be of the type string, int returned Dec 5, 2020
@tsteur
Copy link
Member

tsteur commented Dec 6, 2020

@sgiehl any idea how this might happen? Looking at the code it should always return a string.

I see it might return false though if the brand is not found. It seems technically that method is not even in use anymore. @gusevmaksim how did you upgrade to Matomo 4? Using the one click UI upgrade or by any chance did you upgrade manually?

@sgiehl
Copy link
Member

sgiehl commented Dec 6, 2020

@tsteur That should be already fixed in device detector. Seems it wasn't included in the last release. It happens when a device is detected that has a brand with a short code that only contains numbers like the brand 8848. Will release a new version of Device Detector tomorrow and update it in Matomo afterwards

@sgiehl sgiehl self-assigned this Dec 6, 2020
@sgiehl sgiehl added this to the 4.0.3 milestone Dec 6, 2020
@tsteur tsteur added the Regression Indicates a feature used to work in a certain way but it no longer does even though it should. label Dec 6, 2020
@gusevmaksim
Copy link
Author

I updated in one click from version 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants