I steel have the same probleme on drupal 10.3 with a view_simple_math_field..
Sum was calculated exactly like the picture...
For me, it's because $field_handler->view->style_plugin->getCell(..) in views_aggregator_get_cell return also the preffix and suffix of the field but vap_num() need only the value !
So I changed views_aggregator_get_cell like this
function views_aggregator_get_cell(FieldHandlerInterface $field_handler, int $row_num, bool $rendered = FALSE): string {
if(!$rendered){
if (isset($field_handler->view->result[$row_num])) {
$row = $field_handler->view->result[$row_num];
return $field_handler->getValue($row);
}
}
if (isset($field_handler->view->style_plugin)) {
return $field_handler->view->style_plugin->getCell($field_handler, $row_num, $rendered);
}
return '';
}
And know my sum is good !
johaziel → created an issue.
Hi, I got the same error with ECK !
To reproduce this issue :
- Install eck
- Create new entity type (leave disable "author field"), create a bundle and add fields
- Try to add content admin/content/your_entity/add/your_bundle
the error appear
Edit your entity type admin/structure/eck/your_entity
and enable "author field" and the error disappear.
Regards