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

Mark unrecognized devices as desktop #250

Closed
wants to merge 1 commit into from
Closed

Conversation

quba
Copy link
Contributor

@quba quba commented Mar 27, 2014

Fixes error while tracking new visit using mysql 5.6 default config (STRICT_TRANS_TABLES) as it won't cast empty string to 0.

SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'config_device_type'

Fixes error while tracking new visit using mysql 5.6 default config (STRICT_TRANS_TABLES) as it won't cast empty string to 0.

`SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'config_device_type'`
@sgiehl
Copy link
Member

sgiehl commented Mar 27, 2014

Thanks for your PR. Imho it is incorrect to set device type to desktop by default. Unrecognized devices are not always desktop devices. There are a plenty of mobile and other devices that are not detected by now. Piwik should display unrecognized device types as Unknown. If there is an error I guess it occurs where the data is inserted, maybe it needs to be NULL instead of an empty string.

@quba
Copy link
Contributor Author

quba commented Mar 27, 2014

Yes, you are right (this field allows null) but I didn't want to change anything. Currently piwik is passing empty string to query and mysql (with default config below 5.6) converts it to 0.

@quba
Copy link
Contributor Author

quba commented Mar 27, 2014

Tests are failing with this change so I'll change it to null and change tests fixtures.

@mattab mattab closed this Mar 27, 2014
@mattab
Copy link
Member

mattab commented Mar 27, 2014

+1 we should fix the actual root cause of the bug and not the data itself, eg. do not insert the values in the visitorArray if they are empty or something. let me know I could take a look... (or create a ticket!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants