If there are multiple blocks with aggregated data on the view page, then one block is shown correctly, the other shows 1

Comments

kazah created an issue.

tr’s picture

Can you post instructions for reproducing this problem?

kazah’s picture

1. Create view with aggregated field by views aggregated plus module.

2. Create two views with views fields (field view module)

3. Add gregated field in this views field.

4. Show these two views as blocks on one page.

5. Only one view will show correct result, another always show "1" as result

jordik’s picture

I do not understand the steps to reproduce. Can you be more specific please? And what is the exact name/url of the module you are using?

kazah’s picture

My use case:

1. My node is a cake.

2. I use webform module block as comment form to nodes.

3. I would like to show comments count for cakes in catalog page.

4. I could't aggregate view with cakes and check COUNT in comments field because it show error MAX_JOIN_SIZE (or something like this).

5. So I create another view with agregated option. To insert this field in my catalog view I need Views Field View.

6. In my catalog page I have another view with popular cakes and a comments field in it.

7. If one cake exist in both views - field comment will be different. In one view the result will be correct, in another always "1".

jordik’s picture

Assuming you want to have a table like this (where each cake is present only once):

Cake | Comments
--------------------------------
Chocolate Cake | 6
--------------------------------
Velvet Cake | 3

Create a view based on the webform submissions (comments), not on the cake nodes. You should already have a field with your entity ID (cake) and title. If not you should add a relationship and get the cake title. Then "group and compress" on the cake ID and count on the comments. This should give you a clean table like the one above without using contrib modules and nesting views as views fields.

kazah’s picture

You didn't understand correctly.

I need a catalog view. There are nodes with comments and without.

I could add relationship to my webform with comments but if you have 23 fields in view (some of them are paragraphs) and check "group and compress" and add count to comments field you'll get error:

ERROR 1104 (42000): The SELECT would examine more than MAX_JOIN_SIZE rows;
check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=#
if the SELECT is okay