Passing string value for `groupBy` parameter on `Partition` class results in Exception
benpdavison opened this issue · 6 comments
- 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.
@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.
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";
Downgrading to 4.33.0 works around the problem for now.
@cweiske yep thats what we did