Having big problem with duplicates in commerce product views

Created on 9 December 2022, over 2 years ago
Updated 27 February 2023, about 2 years ago

Hi I wonder if your module can help us. I have extended default commerce product view and added more relations and more columns..
but the result is a deisaster...i get duplicate or triple skus of the same product.

here is my query if you can look at it perhaps

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__field_images.field_images_' in 'field list': SELECT COUNT(*) AS "expression" FROM (SELECT "commerce_product_variation_field_data_commerce_product__variations"."sku" AS "commerce_product_variation_field_data_commerce_product__vari", "commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__field_images"."field_images_" AS "commerce_product_variation_field_data_commerce_product__vari_1", "commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__commerce_price"."commerce_price_" AS "commerce_product_variation_field_data_commerce_product__vari_2", "commerce_product_field_data"."status" AS "commerce_product_field_data_status", "commerce_product__field_catalog"."field_catalog_target_id" AS "commerce_product__field_catalog_field_catalog_target_id", "commerce_product_field_data"."created" AS "commerce_product_field_data_created", "commerce_product_field_data"."title" AS "commerce_product_field_data_title", "commerce_product_field_data"."changed" AS "commerce_product_field_data_changed", DATE_FORMAT((DATE_ADD('19700101', INTERVAL commerce_product_field_data.created SECOND) + INTERVAL 3600 SECOND), '%Y%m%d') AS "commerce_product_field_data_created_day", 1 AS "expression" FROM "commerce_product_field_data" "commerce_product_field_data" LEFT JOIN "commerce_product__variations" "commerce_product__variations" ON commerce_product_field_data.product_id = commerce_product__variations.entity_id AND commerce_product__variations.deleted = :views_join_condition_0 LEFT JOIN "commerce_product_variation_field_data" "commerce_product_variation_field_data_commerce_product__variations" ON commerce_product__variations.variations_target_id = commerce_product_variation_field_data_commerce_product__variations.variation_id LEFT JOIN "commerce_product__field_catalog" "commerce_product__field_catalog" ON commerce_product_field_data.product_id = commerce_product__field_catalog.entity_id AND commerce_product__field_catalog.deleted = :views_join_condition_1 INNER JOIN "taxonomy_term_field_data" "taxonomy_term_field_data_commerce_product__field_catalog" ON commerce_product__field_catalog.field_catalog_target_id = taxonomy_term_field_data_commerce_product__field_catalog.tid LEFT JOIN "commerce_product_variation__field_images" "commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__field_images" ON commerce_product_variation_field_data_commerce_product__variations.variation_id = commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__field_images.entity_id AND commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__field_images.deleted = :views_join_condition_2 LEFT JOIN "commerce_product_variation__commerce_price" "commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__commerce_price" ON commerce_product_variation_field_data_commerce_product__variations.variation_id = commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__commerce_price.entity_id AND commerce_product_variation_field_data_commerce_product__variations__commerce_product_variation__commerce_price.deleted = :views_join_condition_3 WHERE ("commerce_product_field_data"."status" = :db_condition_placeholder_0) AND ("commerce_product__variations"."delta" = :db_condition_placeholder_1) GROUP BY commerce_product_field_data.product_id, commerce_product_variation_field_data_commerce_product__vari, commerce_product_variation_field_data_commerce_product__vari_1, commerce_product_variation_field_data_commerce_product__vari_2, commerce_product_field_data_status, commerce_product__field_catalog_field_catalog_target_id, commerce_product_field_data_created, commerce_product_field_data_title, commerce_product_field_data_changed, commerce_product_field_data_created_day) "subquery"; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:views_join_condition_0] => 0 [:views_join_condition_1] => 0 [:views_join_condition_2] => 0 [:views_join_condition_3] => 0 )#

πŸ’¬ Support request
Status

Closed: cannot reproduce

Version

2.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024