I can't reduce duplicates in views and when I try to activate Distinct function I get following error:
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), users.name AS users_name, users.uid AS users_uid, u' at line 1 query: SELECT COUNT(*) FROM (SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), users.name AS users_name, users.uid AS users_uid, users.mail AS users_mail FROM node node LEFT JOIN users_roles users_roles_value_0 ON node.uid = users_roles_value_0.uid AND users_roles_value_0.rid = 7 INNER JOIN users users ON node.uid = users.uid WHERE users_roles_value_0.rid = 7 ORDER BY users_name ASC ) count_alias in /web/htdocs/www.snowpedia.it/home/sites/all/modules/views/includes/view.inc on line 705.
# user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT(node.nid), users.name AS users_name, users.uid AS users_uid, u' at line 1 query: SELECT DISTINCT(node.nid) AS DISTINCT(node.nid), users.name AS users_name, users.uid AS users_uid, users.mail AS users_mail FROM node node LEFT JOIN users_roles users_roles_value_0 ON node.uid = users_roles_value_0.uid AND users_roles_value_0.rid = 7 INNER JOIN users users ON node.uid = users.uid WHERE users_roles_value_0.rid = 7 ORDER BY users_name ASC LIMIT 0, 100 in /web/htdocs/www.snowpedia.it/home/sites/all/modules/views/includes/view.inc on line 731
I've also tryed to patch with this but no lucky:
Index: sms_user.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/smsframework/modules/sms_user/sms_user.module,v
retrieving revision 1.8
diff -u -p -r1.8 sms_user.module
--- sms_user.module 5 Sep 2008 20:33:59 -0000 1.8
+++ sms_user.module 30 Sep 2008 17:17:14 -0000
@@ -133,10 +133,14 @@ function sms_user_settings_add_form_subm
}
function sms_user_settings_confirm_form(&$form_state, $account) {
+ $value = $account->sms_user[0]['number'];
+ if (isset($account->sms_user[0]['gateway']['country'])) {
+ $value = '+' . $account->sms_user[0]['gateway']['country'] . $value;
+ }
$form['number'] = array(
'#type' => 'item',
'#title' => t('Number'),
- '#value' => $account->sms_user[0]['number'],
+ '#value' => $value,
);
$form['confirm_code'] = array(
'#type' => 'textfield',
@@ -182,10 +186,14 @@ function sms_user_settings_confirm_form_
}
function sms_user_settings_reset_form(&$form_state, $account) {
+ $value = $account->sms_user[0]['number'];
+ if (isset($account->sms_user[0]['gateway']['country'])) {
+ $value = '+' . $account->sms_user[0]['gateway']['country'] . $value;
+ }
$form['sms_user']['number'] = array(
'#type' => 'item',
'#title' => t('Your number'),
- '#value' => $account->sms_user[0]['number'],
+ '#value' => $value,
'#description' => t('Your number has been confirmed.')
);
@@ -527,4 +535,4 @@ function sms_user_sms_receive(&$node, $s
$account = user_load(array('uid' => $uid));
$node->uid = $account->uid;
$node->name = $account->name;
-}
\ No newline at end of file
+}
Comments
Comment #1
infojunkieDo you obtain the same DISTINCT error if you choose a View style different than Bulk Operations?
Comment #2
Anonymous (not verified) commentedno, with other styles DISTINCT function works perfectly
PS sorry the patch regarding index: sms_user.module is for another issue, disregard this
The applied patch is http://drupal.org/node/284392#comment-1049183
Comment #3
infojunkieFrom the long thread in #284392: db_rewrite_sql causing issues with DISTINCT, seems this is a core issue. Does it also appear if you modify the default VBO (a view named admin_content) to use DISTINCT?
I'm not sure what I can do about this but I'll try to reproduce it at least.
Comment #4
Anonymous (not verified) commentedyes it does the error
Comment #5
bojanz commentedIssue is two years old, no updates. Reopen if the bug still exists.