magesuite / brand-management

Open Software License 3.0
4 stars 3 forks source link

Disassociate Brands from Products onDelete #2

Open m-schreiber opened 4 years ago

m-schreiber commented 4 years ago
╰╼ bin/magento index:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index has been rebuilt successfully in 00:00:00
Product Flat Data index has been rebuilt successfully in 00:00:00
Category Products index has been rebuilt successfully in 00:00:00
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:00
Stock index has been rebuilt successfully in 00:00:00
Inventory index has been rebuilt successfully in 00:00:00
Catalog Product Rule index has been rebuilt successfully in 00:00:00
Product Price index has been rebuilt successfully in 00:00:00
Catalog Search indexer process unknown error:
Warning: trim() expects parameter 1 to be string, array given in /var/www/vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php on line 183

This issue occurs when Brands that were deleted are still associated to a product.

  1. vendor/smile/elasticsuite/src/module-elasticsuite-catalog/Helper/AbstractAttribute.php:226 getIndexOptionText tries to get the Option-Label via the Attribute-Source
  2. vendor/creativestyle/magesuite-brand-management/Model/Source/BrandList.php:40 getAllOptions returns all brands currently in the database
  3. vendor/magento/module-eav/Model/Entity/Attribute/Source/AbstractSource.php:64 getOptionText does not find the value (because brand is deleted) and returns the first element in options, which is an value-label-array

And the it all went to hell...

Maybe disassociate the Brands onDelete or report an issue to smile

janssensjelle commented 3 years ago

Got the same issue. Did you manage to find something?