To reproduce:
Get a clean tracker view
Add the field: Node: Updated/commented date. Preview. Note that this works.
Edit the table style settings. Set the field to be sortable.
Preview. This error will show:
* user warning: Unknown column 'node_comment_statistics.last_updated' in 'field list' query: SELECT COUNT(*) FROM (SELECT node.type AS node_type, node.title AS node_title, node.nid AS nid, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp, history_user.timestamp AS history_user_timestamp, node.created AS node_created, node.changed AS node_changed, GREATEST(node.changed, node_comment_statistics.last_comment_timestamp) AS node_comment_statistics_last_updated, node_comment_statistics.last_updated AS node_comment_statistics_last_updated_1 FROM node node INNER JOIN users users ON node.uid = users.uid INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = 1 WHERE node.status <> 0 ) count_alias in /var/www/views3/sites/all/modules/views/plugins/views_plugin_pager.inc on line 141.
* user warning: Unknown column 'node_comment_statistics.last_updated' in 'field list' query: SELECT node.type AS node_type, node.title AS node_title, node.nid AS nid, users.name AS users_name, users.uid AS users_uid, node_comment_statistics.comment_count AS node_comment_statistics_comment_count, node_comment_statistics.last_comment_timestamp AS node_comment_statistics_last_comment_timestamp, history_user.timestamp AS history_user_timestamp, node.created AS node_created, node.changed AS node_changed, GREATEST(node.changed, node_comment_statistics.last_comment_timestamp) AS node_comment_statistics_last_updated, node_comment_statistics.last_updated AS node_comment_statistics_last_updated_1 FROM node node INNER JOIN users users ON node.uid = users.uid INNER JOIN node_comment_statistics node_comment_statistics ON node.nid = node_comment_statistics.nid LEFT JOIN history history_user ON node.nid = history_user.nid AND history_user.uid = 1 WHERE node.status <> 0 ORDER BY node_comment_statistics_last_updated_1 ASC LIMIT 0, 25 in /var/www/views3/sites/all/modules/views/plugins/views_plugin_query_default.inc on line 1090.
Comments
Comment #1
dawehnereasy one :)
Comment #2
merlinofchaos commentedThis might be a more widespread problem than just this one. I believe the base problem is that, formerly, as long as the alias matched, the add_orderby just happened. However, with the GROUP BY stuff, it's actually checking the parameters of the field and if they do not match it creates a new field.
It may be that we just have to keep an eye out for other fields that are both click sortable and use formulas rather than dding fields and make sure they have click sorts.
Comment #3
dawehnerIt's this the same case here: http://drupal.org/node/766992
Comment #4
guntherdevisch commentedAlso worked for me!
Thanks,
Gunther
Comment #5
Balrog commentedPlease see http://drupal.org/node/715740#comment-3373426 -- I'm sure this is not a proper fix, but it works for the time being.
Comment #6
merlinofchaos commentedI think this patch works better:
Comment #7
dawehnerThe field have added itself already
Manual testing works fine.
* Removed the click_sort function in search score field handler.
* Updated based on the documentation of add_orderby
Comment #8
dawehnerRemoved the search field score change.
Comment #9
merlinofchaos commentedCommitted to all branches.
Comment #10
merlinofchaos commentedEr, no. Not committed to 2.x.
Comment #11
dawehnerTo be sure that broken field handlers breaks the query on clicksort a check for the field_alias is added.
This allows to remove the special clicksort for field score again :)
Comment #12
dawehnerRerole against the current CVS
Comment #13
merlinofchaos commentedCommitted to all branches.
Comment #15
dgtlmoon commentedI am still getting this error with views-3 for drupal 6.x
Comment #16
dawehnerWhich version of 6.x-3.x do you use?
If it's the alpha please update to the dev version. This version is much more stable then the other versions.
Comment #17
dawehnerneeds review means that there is a patch.the error disappeared, that's all i can say for now. thanks!
Comment #18
michelleI can't reproduce in the dev snapshot, either. I just set up a dev site because s/he reported this error again against Advanced Forum and it's working fine for me.
Michelle
Comment #19
esmerel commented