Hyrax is a Ruby on Rails Engine built by the Samvera community. Hyrax provides a foundation for creating many different digital repository applications.
The above bug in Matomo introduces some analytics events with metrics recorded as Strings instead of Integers, e.g. "1" instead of 1. Much of Hyrax::Analytics depends on these metrics being numbers instead of strings, so this results in exceptions once Hyrax tries to parse and transform the analytics data.
Type of change (for release notes)
notes-bugfix Bug Fixes
Detailed Description
Any object that has associated analytics events which are/were affected by the Matomo bug above will result in a "Something Went Wrong" exception when you try to view their usage stats, e.g.:
Explicitly cast metrics from Matomo to be integers. See: https://github.com/matomo-org/matomo/issues/21978
Summary
The above bug in Matomo introduces some analytics events with metrics recorded as Strings instead of Integers, e.g.
"1"
instead of1
. Much ofHyrax::Analytics
depends on these metrics being numbers instead of strings, so this results in exceptions once Hyrax tries to parse and transform the analytics data.Type of change (for release notes)
notes-bugfix
Bug FixesDetailed Description
Any object that has associated analytics events which are/were affected by the Matomo bug above will result in a "Something Went Wrong" exception when you try to view their usage stats, e.g.:
Changes proposed in this pull request:
Normalize all metrics from Matomo with an explicit call to
.to_i
at read-time.NB: we can safely simplify
.presence.to_i || 0
to.presence.to_i
here becausenil.to_i
evaluates to0
.@samvera/hyrax-code-reviewers