Open
Description
Preconditions (*)
- Magento version 2.4.2,
- No sample data.
- Navigate to admin
- Go to admin > Stores > Attributes> Product
- Choose any select attribute (E.g. manufacturer)
- Go to Properties > Manage Options (Values of Your Attribute)
- Check that at least one option is added, or add one option (if the attribute has no values, the issue is not reproduced).
- Save the attribute.
Steps to reproduce (*)
- Go to the frontend
- Go to the link your-website .com/catalogsearch/advanced/result?manufacturer=%27%2C+test+%3D
- Check that you see 500 error
- Check report: Undefined index: label in /var/www/html/m242/vendor/magento/module-catalog-search/Model/Advanced.php on line 414
Expected result (*)
- Redirect to catalogsearch/advanced/index page with the message 'Enter a search term and try again.'
Actual result (*)
- Error in the exception.log:
[2021-07-02 08:23:38] main.CRITICAL: Notice: Undefined index: label in /var/www/html/m242/vendor/magento/module-catalog-search/Model/Advanced.php on line 414 {"report_id":"2ca6394ffc40c5a889488d6a3cce70a90d3d20d0a87af3fce0064ec1abafcdf7","exception":"[object] (Exception(code: 0): Notice: Undefined index: label in /var/www/html/m242/vendor/magento/module-catalog-search/Model/Advanced.php on line 414 at /var/www/html/m242/vendor/magento/framework/App/ErrorHandler.php:61)"} []
- Report (
var/report
):
{"0":"Notice: Undefined index: label in \/var\/www\/html\/m242\/vendor\/magento\/module-catalog-search\/Model\/Advanced.php on line 415","1":"#1 Magento\\CatalogSearch\\Model\\Advanced->getPreparedSearchCriteria() called at [vendor\/magento\/module-catalog-search\/Model\/Advanced.php:206]\n#2 Magento\\CatalogSearch\\Model\\Advanced->addFilters() called at [vendor\/magento\/module-catalog-search\/Controller\/Advanced\/Result.php:62]\n#3 Magento\\CatalogSearch\\Controller\\Advanced\\Result->execute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#4 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#5 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/App\/Action\/Plugin\/ActionFlagNoDispatchPlugin.php:51]\n#6 Magento\\Framework\\App\\Action\\Plugin\\ActionFlagNoDispatchPlugin->aroundExecute() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#7 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#8 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/CatalogSearch\/Controller\/Advanced\/Result\/Interceptor.php:23]\n#9 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->execute() called at [vendor\/magento\/framework\/App\/Action\/Action.php:111]\n#10 Magento\\Framework\\App\\Action\\Action->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#11 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#12 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#13 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/CatalogSearch\/Controller\/Advanced\/Result\/Interceptor.php:32]\n#14 Magento\\CatalogSearch\\Controller\\Advanced\\Result\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/FrontController.php:186]\n#15 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor\/magento\/framework\/App\/FrontController.php:118]\n#16 Magento\\Framework\\App\\FrontController->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#17 Magento\\Framework\\App\\FrontController\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#18 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-store\/App\/FrontController\/Plugin\/RequestPreprocessor.php:99]\n#19 Magento\\Store\\App\\FrontController\\Plugin\\RequestPreprocessor->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#20 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-page-cache\/Model\/App\/FrontController\/BuiltinPlugin.php:75]\n#21 Magento\\PageCache\\Model\\App\\FrontController\\BuiltinPlugin->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#22 Magento\\Framework\\App\\FrontController\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#23 Magento\\Framework\\App\\FrontController\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Framework\/App\/FrontController\/Interceptor.php:23]\n#24 Magento\\Framework\\App\\FrontController\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/Http.php:116]\n#25 Magento\\Framework\\App\\Http->launch() called at [generated\/code\/Magento\/Framework\/App\/Http\/Interceptor.php:23]\n#26 Magento\\Framework\\App\\Http\\Interceptor->launch() called at [vendor\/magento\/framework\/App\/Bootstrap.php:263]\n#27 Magento\\Framework\\App\\Bootstrap->run() called at [pub\/index.php:29]\n","url":"\/index.php\/catalogsearch\/advanced\/result?manufacturer=%27%2C+test+%3D","script_name":"\/index.php","report_id":"2ca6394ffc40c5a889488d6a3cce70a90d3d20d0a87af3fce0064ec1abafcdf7"}