1

I'm using Views Summarize module for one of my views. I need to output the field as link and sum them up, but the total is displayed as $0. When I uncheck the output the field as link option, the total is displayed correctly.

https://i.stack.imgur.com/SNK0h.png

Anyone has a solution for this?

2 Answers 2

0

Have you seen this issue on drupal.org: http://drupal.org/node/1880450?

It looks like this is actually a bug in the module - not anything you're doing wrong. However, there seems to be a user-submitted patch that fixes issues with decimals, currency, etc that you can try out...

1
  • This is great. Thanks a lot. I will take a look at it.
    – Firyn
    Feb 21, 2013 at 19:46
0

I came up with my own solution to this problem. All you need to do is to modify the module file.

Within the foreach ($data as $val) add this right after

if (strpos($val, '</a>') !== false) {
  preg_match('/<a ?.*>(.*)<\/a>/', $val, $value);
  $val = $value[1];
}
1
  • Cool. Now, the only problem with modifying the module files directly is that now your module version isn't the same as the one posted on drupal.org, and you'll run into your changes being overriden if you ever update the module! That's why it's better to do a pending patch (as below) or post your modifications to the module's issue queue to be incorporated into the official module. Hope that makes sense!! Feb 27, 2013 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.