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

Passing string value for groupBy parameter on Partition class results in Exception #6403

Closed
benpdavison opened this issue May 24, 2024 · 6 comments
Assignees
Labels
bug Verified bug by the Nova team
Milestone

Comments

@benpdavison
Copy link

benpdavison commented May 24, 2024

  • Laravel Version: 9.52.16
  • Nova Version: 4.34.2
  • PHP Version: 8.1.28
  • Database Driver & Version: Mysql 8.0
  • Operating System and Version: Sonoma 14.4.1
  • Browser type and version: Chrome 124.0.6367.210
  • Reproduction Repository: https://github.com/benpdavison/nova-issue

Description:

Exception produced when passing a string param as groupBy parameter to Aggregate metric such as count function.
Call to a member function getValue() on string on laravel/nova/src/Metrics/Partition.php(114) introduced in 4.34.0

Detailed steps to reproduce the issue on a fresh Nova installation:

Set up a any Partition metric as per docs https://nova.laravel.com/docs/metrics/defining-metrics.html#partition-metrics
I am using the count function within the calculate as per the docs.
Ensure 3rd param, groupBy is a string, then load up the metric via the dashboard, error should appear via toast.

@benpdavison benpdavison changed the title Passing string value for groupBy parameter on Partition metric results in Exception Passing string value for groupBy parameter on Partition class results in Exception May 24, 2024
@benpdavison
Copy link
Author

benpdavison commented May 24, 2024

@crynobone I have added replication repo for this now https://github.com/benpdavison/nova-issue let me know if any additional steps apart from installing nova etc are needed.

@crynobone crynobone added the bug Verified bug by the Nova team label May 27, 2024
@crynobone crynobone self-assigned this May 28, 2024
@adrenaxus
Copy link

I do experience this bug as well. A Partition Metric that which used to work fine suddenly produces this error:

"Call to a member function getValue() on string";

@crynobone crynobone added this to the 4.x milestone Jun 1, 2024
@cweiske
Copy link

cweiske commented Jun 6, 2024

Downgrading to 4.33.0 works around the problem for now.

@benpdavison
Copy link
Author

@cweiske yep thats what we did

@adrenaxus
Copy link

@cweiske Thank you for the suggestion. Hoping the issue will get fixed soon, thanks in advance to anybody looking into it ;)

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Verified bug by the Nova team
Projects
None yet
Development

No branches or pull requests

4 participants