magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.35k stars 9.28k forks source link

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

Open usuyukiso opened 2 years ago

usuyukiso commented 2 years ago

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"}
m2-assistant[bot] commented 2 years ago

Hi @usuyukiso. Thank you for your report. To help us process this issue please make sure that you provided the following information:

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

:movie_camera: You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 2 years ago

Verified the issue on Magento 2.4-develop branch and the issue is reproducible: Steps to reproduce:

  1. Navigate to admin -> Stores > Attributes> Product
  2. Choose any select attribute (E.g. manufacturer)
  3. Go to Properties > Manage Options (Values of Your Attribute)
  4. Check that at least one option is added, or add one option (if the attribute has no values, the issue is not reproduced).
  5. Save the attribute.
  6. Navigate to the front-end
  7. Go to the link your-website .com/catalogsearch/advanced/result?manufacturer=%27%2C+test+%3D Issue: Below error message is getting displayed with 500 Status Code image
magento-engcom-team commented 2 years ago

:white_check_mark: Confirmed by @engcom-November Thank you for verifying the issue. Based on the provided information internal tickets MC-42851 were created

Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

vlmed commented 2 years ago

@magento I am working on it

engcom-Bravo commented 5 days ago

Hi @usuyukiso,

Thanks for your reporting and collaboration.

We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots.

Screenshot 2024-06-24 at 11 50 44

Error in Logs.

Hence Confirming the issue.

Thanks.

github-jira-sync-bot commented 5 days ago

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-12286 is successfully created for this GitHub issue.

m2-assistant[bot] commented 5 days ago

:white_check_mark: Confirmed by @engcom-Bravo. Thank you for verifying the issue.
Issue Available: @engcom-Bravo, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.