Active
Project:
Views PHP
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Aug 2011 at 10:41 UTC
Updated:
16 Jul 2012 at 18:29 UTC
Fields created with Views PHP cannot be aggregated.
Example: In View based on node there's a NID field. I'm adding a 2nd field (Views PHP) with:
Value code: return ($row->nid % 2) ? 0 : $row->nid; // Show even NIDs or zero.
Output code: <?php print $value; ?>
Field looks OK but after turning ON aggregation and set the aggregation to SUM on both columns, both will show the SUM of all NIDs... The Views PHP field should show the SUM of even NIDs.
Comments
Comment #1
patchshorts commentedConfirmed this is a problem. Out put code can be return 1; and you set aggregation to on and the field to count, the whole table disappears for me.
Comment #2
quickly commentedI am having similar issue... PHP is giving the right output but when aggregation is turned on there is no aggregation...
Comment #3
quickly commentedjust checked the forums of Views Calc... Views Calc and Views php are not compatible... views calc generates queries on database, it cannot perform aggregation for any custom/global field..
Comment #3.0
quickly commentedSmall fix on the code comment.