Closed (fixed)
Project:
Views Calc
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
6 Apr 2011 at 19:03 UTC
Updated:
30 Nov 2012 at 00:04 UTC
I think the D7 version is not complete, or is broken with the newer Views releases
1. I get an error regarding below code:
// display current views calcs fields
$fields = _views_calc_fields();
- while ($field = db_fetch_array($fields)) {
+ foreach ($fields as $field) {
$form[] = views_calc_field_form_item($i, $field, $substitutions);
$i++;
}
2. On admin/config/views_calc, I get Notice: Undefined index: #children in theme_fieldset() (line 2649 of ..\includes\form.inc).
3. In Views, when I try to select the Tree (adjacency model) the view mode doesn't get selected.
Comments
Comment #1
johnvAlso, documentation says "The 'Columns' tab allows you to set column calculations."
There is no such tab.
Comment #2
rnj786 commentedI had to use views_calc in one of my recent projects on D7, I had tough time trying to figure out all that is broken. I was able to change the db_fetch_array to foreach since this was mentioned on the D7 upgrade guide. However there are other problems with the D7 version of this module which need to be addressed.
The Calculation results are displayed as "node" instead of the actual number, especially when you have relationships or have a field or two from user table.
Maintainers & Generous contributors please step up and make the D7 version of this module usable. Also provide us some lead as to where exactly are the calculations done ? If there is any developers documentation, please let me know, i will go through the documentation and try to work on fixing it.
THANKS
rnj786
Comment #3
danepowell commentedThat's a shame, I was really hoping to use views_calc on a D7 project. Any chance this could be fixed? If it's just minor stuff dealing with upgrade from D6 to D7 I can probably take a crack at it, but I'd like some assurance that patches would be accepted and support would continue to be provided... this module seems like it's practically been abandoned.
Comment #4
miro_dietikerAbandoned???
Dane, please read the statements:
"A partial resource-optimized rewrite, major cleanup (6.x-2.x), a Port for Views 6.x-3.x and a Port for Drupal 7 has recently been submitted by Miro Dietiker of MD Systems.".
It is fully maintained. Just provide clean patches and provide solutions and you'll see things going on.
I cannot see any issue that contains a reviewed patch. Do you?
Comment #5
danepowell commentedSorry, no offense intended- but with no official release in two years, the release that's already out there not 100% working (IIRC), and no commits by KarenS in over a year- you'll understand my concern. But, I'm glad to hear there's still development taking place behind the scenes, and I'll try to throw a patch together.
Comment #6
danepowell commentedI can confirm that replacing the
db_fetch_array()call as proposed by johnv solves the immediate problem of a WSOD, but beyond that I'm really not sure how to set about fixing things- as rnj786 said, this module is pretty complex and there seems to be a long way to go for a D7 release. As contributors not intimately familiar with the code, it's hard to help.Comment #7
rnj786 commentedDane, I have several other random issues along with the ones i mentioned above. One of the other problems is handling of Float types, all my calculations would provide the result double than the actual result when the field data is float.
I know there was some core issue with views about query caching (or DISTINCT) producing queries twice and generating double results. They said it was fixed in Views 3, so i don't know how this happens here again.
The way this module is trying to do calculations is still not clear. I am almost about to give up on this, I am checking out datatables module which is capable of providing the footer callbacks but it hasn't been developed for drupal yet which i am sure people are working on, subscribe to that feature request there to expedite the development !!
Comment #8
yugongtian commented+1
Comment #9
hansfn commentedsubscribe
Comment #10
RealBirkoff commentedsubscribe
Comment #11
BenK commentedSubscribing
Comment #12
dayer4b commentedsubscribing
Comment #13
miro_dietikerSince Drupal Core changed a lot in fields handling finally, we need to rework the whole module.
At the time of views alpha1 things worked perfectly in our port.
However, Drupal core and Views changed so much that this won't help us much.
I cannot find a simple way with my limited time to adapt the current code to the final changes.
Meanwhile i'm sorry there won't be any alternative without a next contributor of funds provider. Things will take days, not hours.
Merlinofchaos is interested in adding aggregation support into views itself. However this will take a lot of time.
Removed the 7.x-1.x snapshot from the release list.
EDIT: Note that this only hits fields / fieldable entities. If you define own fields in hook_views_data, things might work cleanly. This case is less work and possibly much more subject of being fixed soon.
Comment #14
danepowell commentedSpeaking of aggregation support in Views itself- I just noticed that if you enable grouping for a view (WITHOUT views_calc installed), and click on 'group settings', you can choose from various 'aggregation functions', including summation. Has anyone tried this? It doesn't sound nearly as fully-featured as views_calc, but it might help someone.
Comment #15
johnvI tried in January, there are some issues in the Views queue (look for GROUP BY / GROUPBY), and at that moment, it didn't work yet. Perhaps it has improved.
Comment #16
OldAccount commentedSubscribing
Comment #17
rogical commented+1
Comment #18
spacereactor commented+1
Comment #19
kevin.mcnamee@mailbox.org commentedsubscribing
Comment #20
jason@greengeckodesign.com commentedsubscribing
Comment #21
intu.cz commented+1
Comment #22
anektod commentedsubscribing
Comment #23
david_de commentedsubscribing
Comment #24
drupov commentedsubscribe
Comment #25
chalee commentedsubscribe
Comment #26
delty commented+1
Comment #27
Refineo commentedsubscribing
Comment #28
aliceduck commentedsubscribing
Comment #29
shaisamuel commentedsubscribing
Comment #30
Geex2011 commentedsub+
Comment #31
Yuri commented+1
Comment #32
jaspher commented+1
Comment #33
Yuri commentedIt is sad that such a useful module is currently not available for D7. Hope that someone steps forward to pick up maintenance.
Comment #34
nagiek commentedHere's a hack: create a view as an attachment, turn on aggregation, and voila. Not the best, but not that hack-y either.
Comment #35
wizonesolutionsI was thinking of that approach as well, since Views does have aggregation capabilities now.
Comment #36
nagiek commentedYeah, it's actually working pretty well for me. Add in a rewrite to call your label field "Sum" and some CSS to remove the header, and it looks great.
Comment #37
Yuri commentedWell, I can't get the sum aggregation to work, it just does not show up when enabling aggregation on a decimal field. How exactly did you do that?
What version of views are you using? Applied any patches? I've installed the latest dev version.
Comment #38
Francesco1910 commentedSubscribe!
Comment #39
wizonesolutionsFrancesco1910: You can now use the follow button at the top-right of the issue to subscribe.
Comment #40
patoshi commentedsubbing
Comment #41
peterx commentedMy interest is to use something to generate input for the Charts module. Is there anyone else interested in working on Views Calc for Views 3 and D7 to feed Charts?
If the approach mentioned by nagiek works then we could start a documentation page describing the approach. The alternative would be to have a D7 branch somewhere so people can work on it toward a D7 version.
Comment #42
pbeakley commentedWe are extremely interested but I personally lack the technical expertise to assist. However, my client would be happy to financially support the work. Not sure how much is "enough" and we've never done a donation-for-development type thing before. What's involved? Is there a specific developer out there who wants to take this on for a few hundred dollars?
Comment #43
tedchwang commentedI'm very interested in this, too. If a developer wants to give a quotation for this work, I'll be happy to chip in to the pool of funds.
Anyone else willing to contribute financially to this?
Comment #44
john bickar commentedThe functionality of Views Calc is (at least partially) provided by the aggregation functions in Views 7.x-3.x, which now has a stable release.
I found the screencasts linked from this page helpful:
http://dev.nodeone.se/en/blog/using-aggregation-in-views
Comment #45
derp commentedsubscribe
Comment #46
derp commentedHi Miro,
I understand that quite some work is needed to get this fixed. Is there a list available somewhere of items that need rewriting or fixing? Would a budget, sponsorship or funding help in any way to get this module back onto a production level?
Cheers,
derp.
Comment #47
Phibo commentedsubscribe
Comment #48
dannygoh commentedI am currently using Views Summarize for my Drupal 7 projects.
Comment #49
doana commentedThank you, dannygoh! Views Summarize worked like a charm for my D7 site.
Comment #50
karens commentedThe table display part of the code should be working now. Haven't worked on custom fields yet.
Comment #52
jessepinho commenteddannygoh: Nice! Views Summarize worked perfectly for my purposes as well. Thanks!