Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
With the Advanced setting "Use aggregation: Yes", I'm getting an error referring to the first column that has "Display calculation" ticked in a simple View formatted as "View Calc Table".
SQLSTATE[42000]: Syntax error or access violation: 1056 Can't group on 'count__node_nid'
Using MAMP stack as follows:
Database system MySQL 5.5.25
Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/0.9.8x DAV/2 PHP/5.4.4
Comment | File | Size | Author |
---|---|---|---|
#2 | views_calc-aggregation_switched_on_error-2036817-2.patch | 1.99 KB | Niremizov |
Comments
Comment #0.0
RdeBoerMention MAMP stack and version numbers
Comment #0.1
RdeBoertypo
Comment #1
ibraaheem CreditAttribution: ibraaheem commentedI have this issue too.
Comment #2
Niremizov CreditAttribution: Niremizov commentedI have made a patch. Should be working fine after applying.
Comment #3
Niremizov CreditAttribution: Niremizov commentedChanged status.
Comment #4
Niremizov CreditAttribution: Niremizov commentedThis
Comment #5
Niremizov CreditAttribution: Niremizov commentedI have uploaded patch to the realted issue "Add grouping support for views calc" - https://www.drupal.org/node/140665#comment-9017249 - This patched is based on #2.
Comment #6
Niremizov CreditAttribution: Niremizov commentedDeleted reference here cause it is already added in related issue.
Comment #7
mgiffordThis patch still applies nicely, but I'm having trouble replicating the problem.
Is there a default view that you're using that we could compare this with? I'm just trying to see on SimplyTest.me.
Comment #8
Niremizov CreditAttribution: Niremizov commentedOk. To replicate:
1) Create new view that shows content, set display format: Views Calc Table
2) To the fields list add Nid. (Inside views FIELDS section)
3) Enable aggregation mode. (Inside views OTHER section)
4) Go into Views Calc Table style settings(Inside FORMAT section). Check checkbox Display Calculation for NID field, and for example select Count method.
After that save view and try to preview it...
SQLSTATE[42000]: Syntax error or access violation: 1056 Can't group on 'count__nid_1'
Comment #9
dobrzyns CreditAttribution: dobrzyns at Promet Source commentedThis patch applies nicely and resolves the issue. Upon enabling Aggregation and Display Calculation for a NID or Title field, the sql error no longer appears.