What I am trying to do is when you view an article, it displays other authors that write in this particular subject. We have gotten it to work, but we only want to display only unique authors. We were able to get it working using this module with RC1 (Get the author name and Uid and do a count on the Uid), but when we upgraded to RC2, it broke and I can't figure out a solution.

Here is the query being run:

SELECT node.nid AS nid,
node_data_field_article_author.field_article_author_uid AS node_data_field_article_author_field_article_author_uid,
node.type AS node_type,
node.vid AS node_vid,
COUNT(users.uid) AS users_uid
FROM node node
INNER JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN content_type_article node_data_field_article_author ON node.vid = node_data_field_article_author.vid
INNER JOIN users users ON node.uid = users.uid
WHERE (node.type in ('article')) AND (term_node.tid = 1)
GROUP BY node_data_field_article_author_field_article_author_uid, nid, node_type, node_vid
ORDER BY users_uid DESC

CommentFileSizeAuthor
#9 views_grouby_rc1_rc2.diff4.6 KBWorldFallz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

irakli’s picture

Is this the query from RC2?

Any chance you might be able to post queries from both versions, so that we can compare?

Thank you

mongothemad’s picture

Here is from RC1:

SELECT node.nid AS nid,
node_data_field_article_author.field_article_author_uid AS
node_data_field_article_author_field_article_author_uid,
node.type AS node_type,
node.vid AS node_vid,
COUNT(users.uid) AS users_uid
FROM node node
INNER JOIN term_node term_node ON node.vid = term_node.vid
LEFT JOIN content_type_article node_data_field_article_author ON
node.vid = node_data_field_article_author.vid
INNER JOIN users users ON node.uid = users.uid
WHERE (node.type in ('article')) AND (term_node.tid = 1)
GROUP BY node_data_field_article_author_field_article_author_uid, nid,
node_type, node_vid
ORDER BY users_uid DESC

When we reverted back, it worked just as it did before.

mongothemad’s picture

Category: support » bug

switched from support to bug report. (Since it works in RC1 and not RC2)

irakli’s picture

Andrew,

the two SQLs you posted are exactly the same. Can you, please, provide SQLs generated when run with RC2 and RC1? That would be tremendous help.

Thank you

Irakli

irakli’s picture

Status: Active » Postponed (maintainer needs more info)
rsevero’s picture

Assigned: Unassigned » rsevero
Status: Postponed (maintainer needs more info) » Fixed

Marking it fixed for lack of info.

Please reopen with extra info if necessary.

WorldFallz’s picture

Status: Fixed » Active

I can replicate this.

The query I get from RC1 is:

SELECT COUNT(node.nid) AS nid,
   node_data_field_status.field_status_value AS node_data_field_status_field_status_value
 FROM node node 
 LEFT JOIN content_type_arb_questionnaire node_data_field_status ON node.vid = node_data_field_status.vid
 WHERE node.type in ('arb_questionnaire')
 GROUP BY node_data_field_status_field_status_value
  ORDER BY nid DESC

And the query I get from RC2 is:

SELECT COUNT(node.nid) AS nid,
   node_data_field_status.field_status_value AS node_data_field_status_field_status_value
 FROM node node 
 LEFT JOIN content_type_arb_questionnaire node_data_field_status ON node.vid = node_data_field_status.vid
 WHERE node.type in ('arb_questionnaire')
 GROUP BY node_data_field_status_field_status_value, node_type, node_vid
  ORDER BY nid DESC

Notice the extra node_type, node_vid on the GROUP BY line of RC2.

rsevero’s picture

Yes, I've seen this problem before in Views GroupBy.

I have a suggestion for this kind of issues: drop Views GroupBy and use Views 3 which has grouping functionality embedded. I know it's still alpha but it's in bug squashing mode as far as I can tell and it's really usable.

Let me clarify that I'm not a maintainer for neither Views GroupBy nor Views.

I'm leaving it open in case someone decides to tackle this issue.

WorldFallz’s picture

FileSize
4.6 KB

Yes--- views 3 is amazing and completely obviates the need for views_groupby. It's also quite stable and I use it in a number of sites already so it's definitely worth trying.

I'm just not sure how stable it will be using it with all the other views related contribs out there (like views_charts, views_slideshow, etc.).

I took a look at the diff between rc1 and rc2 but this is way into the views api which is still pretty much over my head. It's probably not worth spending too much time on it since views 3 is available-- but i've attached the diff in case someone wants to take a quick look.

rsevero’s picture

I briefly tested Views Charts with Views 3 and all (few) tests I made worked as expected.

I would be inclined to adapt Views Charts to Views 3 if anybody finds any problem in this area. Please open any relevant issue in Views Charts queue.

zeezhao’s picture

Fyi - as I came across this thread, I did a quick test on a site close to production with views 3.x and all the latest views* modules + charts*.

I noticed that csv/xls exports were now being truncated to one page only. It may well be that views_bonus is not yet compatible with views 3.x. Thought I'd mention this. In any case, I have to stick with views 2.11 since site is close to go-live now...