bagisto icon indicating copy to clipboard operation
bagisto copied to clipboard

Product saved; product not shown in admin/catalog/products and/or website "No products available in this category"

Open lukasmedia opened this issue 2 years ago • 11 comments

Issue Description

When i add a product using /admin/catalog/products/create the product is saved (green message product saved) after that a redirect to admin/catalog/products/edit/2 I fill in what is required, hit save. Again, the green box said saved. Then a redirect to admin/catalog/products; but no products.

On the public site (i added several products to main category and subcategory). When i visit category i get:

Whoops! No products available in this category

Bagisto Version

1.4.3 PHP8.1 / MySQL / latest composer Ubuntu server

Steps To Reproduce

See above.

Actual Result

Using the debugbar i found a query with a possible error:

select count(*) as aggregate from (select product_flat.locale, product_flat.channel, product_flat.product_id, products.sku as product_sku, product_flat.product_number, product_flat.name as product_name, products.type as product_type, product_flat.status, product_flat.price, product_flat.url_key, attribute_families.name as attribute_family, SUM(product_inventories.qty) as quantity from product_flat left join products on product_flat.product_id = products.id left join attribute_families on products.attribute_family_id = attribute_families.id left join product_inventories on product_flat.product_id = product_inventories.product_id where product_flat.locale in ('nl') and product_flat.channel in ('default') group by product_flat.product_id, product_flat.locale, product_flat.channel) as aggregate_table

when i run this in phpmyadmin:

#1055 - Expression #5 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'product_flat.product_number' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Expected Result

The products in database should show up somewhere

lukasmedia avatar Aug 09 '22 07:08 lukasmedia

Hi there, I guess the status of the product is inactive so the products are not listed in the shop. Please verify it and let me know.

Sanjaybhattwebkul avatar Aug 09 '22 11:08 Sanjaybhattwebkul

I cannot edit the stored products because they are not visibile in the admin (admin/catalog/products). Then i have to type in the address bar "admin/catalog/products/edit/1" to edit my products. Yes, the status was grey; i changed it to blue. Saved; but still no products in admin and/or website.

lukasmedia avatar Aug 09 '22 11:08 lukasmedia

@lukasmedia Is it possible to share the screen recording for the same it will help me to reproduce the issue?

Sanjaybhattwebkul avatar Aug 09 '22 11:08 Sanjaybhattwebkul

Not really a lot to show but here is the admin:

https://ibb.co/KGDNc3L

and here product detail (remember, i have to type "admin/catalog/products/edit/1" in address bar)

https://ibb.co/fd0L4tJ

FYI i already did 3 installs; 2 via zip download, extract, composer install and installation via artisan and installation via composer. All the same results.

lukasmedia avatar Aug 09 '22 12:08 lukasmedia

Also, database is filled with data. What do you need more? This seems like a major bug to me.

lukasmedia avatar Aug 10 '22 15:08 lukasmedia

Not able to reproduce this, have you done some customization or added some modules?

devansh-webkul avatar Aug 16 '22 05:08 devansh-webkul

No; clean install.

lukasmedia avatar Aug 17 '22 09:08 lukasmedia

Hi there, Please enable Visible Individually, the issue will be resolved.

Sanjaybhattwebkul avatar Aug 19 '22 06:08 Sanjaybhattwebkul

Hi @Sanjaybhattweb thank you; but that didnt help. There is a query error.

The source seems to be "sql_mode=only_full_group_by" so i removed "only_full_group_by" in the my.cnf from Mysql. Restarted mysql but the issue is still there.

lukasmedia avatar Aug 21 '22 19:08 lukasmedia

I have this same problem. +1

The products are added to the DB and viewable from the Customer portal and also accessible via direct slugs but not listed in the Admin Catalog.

asifmohtesham avatar Aug 28 '22 13:08 asifmohtesham

Is it possible to share the screen recording for the same?

Sanjaybhattwebkul avatar Sep 14 '22 08:09 Sanjaybhattwebkul

Not able to reproduce this, please use Bagisto forum.

devansh-webkul avatar Apr 12 '23 16:04 devansh-webkul