Needs work
Project:
Views Aggregator Plus
Version:
2.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
14 May 2022 at 16:10 UTC
Updated:
30 Jun 2025 at 20:18 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Busybee commentedComment #3
jordik commentedMore details would be helpful - e.g. fields snd functions used, settings for the suffix etc.
Comment #4
jordik commentedComment #5
sepa_cleversoft commentedI also have the same problem, without suffix in a custom field generated with a views field plugin.
Comment #6
tr commented@sepa_cleversoft Please provide the additional details requested in #3. Specifically, we need detailed steps to reproduce the error.
Comment #7
sepa_cleversoft commentedI have a view custom field, defined with this code in modules/custom/my_module/src/Plugin/views/field
The field is shown correctly (or at lest it seems) in view. The problem is that the calculation is done without comma or dot for decimals. So 0,5 becomes 05, and the calculation fails.
Comment #8
tr commentedComment #9
sepa_cleversoft commentedDo you need more info to replicate the error?
I suspect that I don't render the field in the correct way, but I also tried everything and it always ignore the decimal separator, giving wrong result.
I don't know if it's a general issue, that affects many other cases, or just something I'm doing wrong.
Let me know if you need something.
Comment #10
marksmith commentedDo you have a rewrite in the field to be summed by VAP? For me the SUM column aggregation function works as expected with regular decimal field with suffix. It does not work, however, if this operation is performed on a twig rewritten custom field, with math calculation that also contains non-numeric values. See both instances in the attached screenshot (D 9.5.3).
Comment #11
sepa_cleversoft commentedI have no twig rewrite or other some of rewriting. The field is just attached to a view. The rows are rendered well, the sum is with trimmed values.
But now I'm sure to not be the only one to notice this annoying error. :)
Comment #12
sepa_cleversoft commentedI fixed the problem disabling the theme debug. I suspect the problem was on views_aggregator_get_cell or vap_num functions.
views_aggregator_get_cell($field_handler, $num, FALSE) returns not only the string with the value, but also the comment for the debug function.
Disabling the theme debug function in services.yml solves it, but the function(s) can be improved to work with the debug on.
Comment #13
jordik commentedDid you have a look at #3325006: views_aggregator\Plugin\views\style\Table->getCell assumes any field not provided by views or webform_views should be rendered?
Seems to tackle the same problem with theme debug.
Please apply the patch and provide feedback whether it solved the problem.
Comment #14
anybodyComment #15
johazielI 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
And know my sum is good !
Comment #16
mortona2k commentedThis issue sounds the same as the related one, I think it's a duplicate: https://www.drupal.org/project/views_aggregator/issues/3472336
The patch in this module seems to fix the calculation and formatting issues: https://www.drupal.org/project/views_aggregator/issues/3482129