Problem/Motivation

When implementing the views_summarize module, the total was not being calculated, further investigation showed that the problem lied in that the template debug was activated and inserting commented strings in the template. Not allowing the transformation from string to float.

Steps to reproduce

In sites/default/services.yml under twig.config: set debug: to true.

Proposed resolution

I have altered the regex to match any HTML comments and remove them before trying to do the calculations. I've added to all the regex I found.

CommentFileSizeAuthor
views_summarize_regex.patch1.71 KBigoragatti

Comments

igoragatti created an issue. See original summary.

oadaeh’s picture

Thanks for reporting this and providing the patch.
Due to #1876548: Changes for presentation logic of views summary and #1880450: "Output this field as a link" breaks the total and total currency summary of a column in table, I switched to using something like this:

preg_replace('/[^0-9\.\,\-]/', '', strip_tags($value))
oadaeh’s picture

Assigned: igoragatti » Unassigned
Status: Needs review » Closed (outdated)

This was already fixed in the 1.1.x-dev branch. I'll tag a new release as soon as I get through the round of clean up I'm currently doing.