You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create an optimizer applicable on the catalog product search container and with search query terms limitations
From the optimizers grid, try to delete the optimizer
Expected result
The optimizer should be deleted, with a success notice being displayed
Actual result
The browser redirects to the optimizer edit screen and an error notice is display with the error message "Warning: Illegal string offset 'id' in /var/www/ee232/vendor/smile/elasticsuite/src/module-elasticsuite-catalog-optimizer/Model/Optimizer/Limitation/Identities.php on line 115"
The issue seems to be that the Identities class expects $data['quick_search_container']['query_ids'] to be an array of dynamic rows as in \Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Limitation\SaveHandler::getQueryIdsLimitation but this is not consistent when simply deleting the optimizer from the grid.
Additionally, Identities is not consistent either with the side effects the ReadHandler perform in \Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Limitation\ReadHandler::getSearchQueryLimitation so I'm a bit lost there.
Anyway, if there are cases (from the edit form ?) where $data['quick_search_container']['query_ids'] is indeed an array of array, a check should be added in the loop to extract the query id either from $query or $query['id'] :
if (!empty($data['quick_search_container']['query_ids'])) {
foreach ($data['quick_search_container']['query_ids'] as $query) {
$queryIds[] = $query['id'];
}
}
The text was updated successfully, but these errors were encountered:
Preconditions
Magento Version : EE 2.3.0, 2.3.2
ElasticSuite Version : 2.8.2 and 2.8.x
Environment : Developer
Third party modules : N/A
Steps to reproduce
Expected result
Actual result
The issue seems to be that the
Identities
class expects$data['quick_search_container']['query_ids']
to be an array of dynamic rows as in\Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Limitation\SaveHandler::getQueryIdsLimitation
but this is not consistent when simply deleting the optimizer from the grid.Additionally,
Identities
is not consistent either with the side effects theReadHandler
perform in\Smile\ElasticsuiteCatalogOptimizer\Model\Optimizer\Limitation\ReadHandler::getSearchQueryLimitation
so I'm a bit lost there.Anyway, if there are cases (from the edit form ?) where
$data['quick_search_container']['query_ids']
is indeed an array of array, a check should be added in the loop to extract the query id either from$query
or$query['id']
:The text was updated successfully, but these errors were encountered: