Skip to content

Fix possible fatal error in VisitTime report #21679

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

Merged
merged 1 commit into from
Dec 13, 2023
Merged

Fix possible fatal error in VisitTime report #21679

merged 1 commit into from
Dec 13, 2023

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Dec 13, 2023

Description:

fixes #21677

Review

@sgiehl sgiehl added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Dec 13, 2023
@sgiehl sgiehl added this to the 5.0.1 milestone Dec 13, 2023
@sgiehl sgiehl requested a review from a team December 13, 2023 08:29
@michalkleiner
Copy link
Contributor

Is this covered by some tests somewhere?

@sgiehl
Copy link
Member Author

sgiehl commented Dec 13, 2023

Not as far as I know. But I actually also don't know how that could happen. Maybe report row truncation is set too low and the report has an others row...

Copy link
Contributor

@bx80 bx80 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to quickly add a unit test, but plugins/VisitTime/functions.php is not a proper class and is being directly included by several column classes in CoreHome, so it would be better to refactor these functions into a more appropriate class in Core or CoreHome and add unit tests there. Which is probably out of scope for this fix.

Maybe it would be good to raise a tech debt ticket to tidy this up at some point?

@sgiehl
Copy link
Member Author

sgiehl commented Dec 13, 2023

We will need to do that anyway. As some rules of PSR12 forbid global functions

@sgiehl sgiehl merged commit dbfae1c into 5.x-dev Dec 13, 2023
@sgiehl sgiehl deleted the m21677 branch December 13, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Development

Successfully merging this pull request may close these issues.

[Bug] mktime(): Argument #1 ($hour) must be of type int, string given in /mnt/efs/plugins/VisitTime/functions.php line 18
3 participants