Hi,
thanks for the 6.x update! Wonderful to get this module in!
I'm using computed fields to calculate prices for some artwork. I'm using views calc to calculate the sum of the artwork prices.
However Views calc seems to handle Computed fields wrong. My field value is in the database, saved alongside other content in content_type_xxxx -table. But views calc query seems to be broken as it tries to fetch the data from a nonexistent table. The computed field is displayed well in normal view.
My error in brief:
when viewing the views calc -view, an SQL error is given (unknown column, references views.inc, line 723). My content type table that has the computed value is called 'content_type_vedos'. The computed field name is 'field_vedoksenhinta_value'. Instead the SQL states that it tries to select the data from 'node_data_field_vedoksenhinta.field_vedoksenhinta_value'. There is no such table as 'node_data_field_vedoksenhinta'! Also, no FROM -statement is made for 'node_data_field_vedoksenhinta' -table.
I'll attach the error in full for all those who want to see it.
user warning: Unknown column 'node_data_field_vedoksenhinta.field_vedoksenhinta_value' in 'field list' query:
SELECT
DISTINCT(node.nid) AS nid,
node_data_field_vedosnumero.nid AS node_data_field_vedosnumero_nid,
node.type AS node_type, '' AS parent,
'SUM' AS TOTAL_SUM,
SUM(node_data_field_vedosnumero.field_vedosnumero_value) AS field_vedosnumero_value,
'' AS field_kehystyyppi_nid,
SUM(node_data_field_kehyshinta.field_kehyshinta_value) AS field_kehyshinta_value,
SUM(node_data_field_vedoksenhinta.field_vedoksenhinta_value) AS field_vedoksenhinta_value
FROM node node
LEFT JOIN workflow_node workflow_node ON node.nid = workflow_node.nid
INNER JOIN content_type_vedos node_data_field_sijainti ON node.vid = node_data_field_sijainti.vid
LEFT JOIN nodehierarchy nodehierarchy ON node.nid = nodehierarchy.nid
LEFT JOIN content_type_vedos node_data_field_vedosnumero ON node.vid = node_data_field_vedosnumero.vid
INNER JOIN node_access na ON na.nid = node.nid
WHERE (na.grant_view >= 1
AND ((na.gid = 0 AND na.realm = 'all')
OR (na.gid = 3 AND na.realm = 'content_access_author')
OR (na.gid = 2 AND na.realm = 'content_access_rid')
OR (na.gid = 3 AND na.realm = 'content_access_rid')
OR (na.gid = 2 AND na.realm = 'workflow_access')
OR (na.gid = 3 AND na.realm = 'workflow_access')
OR (na.gid = 3 AND na.realm = 'workflow_access_owner')))
AND ( (node.status <> 0)
AND (node.type in ('vedos'))
AND (workflow_node.sid = 4)
AND (node_data_field_sijainti.field_sijainti_nid = '129')
AND (node.nid IN (123,125)) )
GROUP BY TOTAL_SUM LIMIT 0, 10
in sites/default/modules/views/includes/view.inc on line 723.
Comments
Comment #1
likewhoa commentedsame error here so we probably hit a bug on 6.x. I am using drupal 6.6 F.Y.I
here is my error.
query is..
Hope this gets resolved soon as I rather not go back to 5.x drupal.
Comment #2
d0t15t commentedHi
w/ Views Calc, Views-6.x-2.1, cck-6.x-2.1, & Drupal 6.8 i get the following error for the SQL query which you can find below... the view works fine w/o Views Calc... any clues what's going on here?
this is what my query looks like:
Comment #3
d0t15t commentedinstalling newest views (views-6.x-2.2) fixed this problem, but now i'm getting
warning: Invalid argument supplied for foreach() in /home/.perry/dotist/dyss.net/artnet/modules/contrib/views_calc/theme.inc on line 156.Comment #4
likewhoa commentedwish I could agree with you but still getting SQL error on multiple column calculations.
using Drupal 6.8, Views 6.x-2.2 & Views Calc 6.x-1.0-rc/6.x-1.x-dev
Comment #5
d0t15t commentedweird... w/ exactly the same set up my SQL probs were fixed, but it's definitely not doing any calculations - just the above mentioned problem w/ the theme not resolving... anybody else?
Comment #6
karens commentedSomething in Views changed after I first got this module working (and yes it did work at one time). The bug is coming from the new Views optimization where it removes tables that are used more than once. In this case I still need those tables, so I have to find a work-around. There are numerous duplicate reports of this same problem so I'm going to keep #358459: User warning: Unknown Table 'node_data_field open and close the others.