Skip to content

Notice: Undefined index: label in magento/module-catalog-search/Model/Advanced.php on line 414 #33408

Open
@usuyukiso

Description

@usuyukiso

Preconditions (*)

  1. Magento version 2.4.2,
  2. No sample data.
  3. Navigate to admin
  4. Go to admin > Stores > Attributes> Product
  5. Choose any select attribute (E.g. manufacturer)
  6. Go to Properties > Manage Options (Values of Your Attribute)
  7. Check that at least one option is added, or add one option (if the attribute has no values, the issue is not reproduced).
  8. Save the attribute.

Steps to reproduce (*)

  1. Go to the frontend
  2. Go to the link your-website .com/catalogsearch/advanced/result?manufacturer=%27%2C+test+%3D
  3. Check that you see 500 error
  4. Check report: Undefined index: label in /var/www/html/m242/vendor/magento/module-catalog-search/Model/Advanced.php on line 414

Expected result (*)

  1. Redirect to catalogsearch/advanced/index page with the message 'Enter a search term and try again.'

Actual result (*)

  1. 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)"} []
  2. 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"}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions