UPSTREAM FIX

magento2-40422: Advanced search warning for dropdown attributes in array parameters

Community fix magento2-40422 merged into magento/magento2 on 2026-05-12, not in a release yet; applies cleanly to 34 releases from 2.4.6 to 2.4.9.

Fixes the advanced search warning for dropdown attributes in array parameters edited

Pull request title
strpos() expects parameter 1 to be string, array given | magento/module-eav
Pull request
magento/magento2#40422
Issues
#33588 human
Author
@KrasnoshchokBohdan
Merged
2026-05-12
Fixed in
no release yet
Reported on
2.4.2
Categories
Catalog/Product
Components
magento/module-catalog-search

Labels

Area
Catalog
Component
Url
Priority
P2
Severity
—
Reported on (labels)
2.4.2

Issue

Title and steps come from the upstream issue and pull request.

Description

There has been an error processing your request Error message is getting displayed on UI
![image](https://user-images.githubusercontent.com/60198231/130946247-832ba68d-455a-4b82-93d1-866f3cc163b2.png)

Steps to reproduce

1. Add any dropdown attribute to advanced search (Admin: Stores -> Attributes -> Product - > Add New Attribute /Choose existing attribute ex: color
Input Type should be: Dropdown
Storefront Properties: Use in Search: Yes, Visible in Advanced Search: Yes)
2. Front-end - Go to /catalogsearch/advanced/result/?color%5B%5D=49,50 (Used color Attribute)

Issue: "There has been an error processing your request" Error message is getting displayed
Note: There is no issue with Text Attribute. URL is working for Text attribute. Issue is observed for dropdown attribute.
This seems to be reported in #25438 but said to be fixed and closed, so I open up another one.

Expected result

It should not throw an unhandled error.
![image](https://user-images.githubusercontent.com/60198231/130946302-8a0ecc14-6b5b-485a-bba9-9bc3455ce9cb.png)

Actual result

There has been an error processing your request Error message is getting displayed on UI
![image](https://user-images.githubusercontent.com/60198231/130946247-832ba68d-455a-4b82-93d1-866f3cc163b2.png)
Exception #0 (Exception): 

[2021-10-07T06:43:05.660813+00:00] main.CRITICAL: Exception: Notice: Undefined index: label in /var/www/html/mg24/magento2/app/code/Magento/CatalogSearch/Model/Advanced.php on line 420 in /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/ErrorHandler.php:61
Stack trace:
#0 /var/www/html/mg24/magento2/app/code/Magento/CatalogSearch/Model/Advanced.php(420): Magento\Framework\App\ErrorHandler->handler()
#1 /var/www/html/mg24/magento2/app/code/Magento/CatalogSearch/Model/Advanced.php(206): Magento\CatalogSearch\Model\Advanced->getPreparedSearchCriteria()
#2 /var/www/html/mg24/magento2/app/code/Magento/CatalogSearch/Controller/Advanced/Result.php(62): Magento\CatalogSearch\Model\Advanced->addFilters()
#3 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\CatalogSearch\Controller\Advanced\Result->execute()
#4 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->___callParent()
#5 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->Magento\Framework\Interception\{closure}()
#6 /var/www/html/mg24/magento2/generated/code/Magento/CatalogSearch/Controller/Advanced/Result/Interceptor.php(23): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->___callPlugins()
#7 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Action/Action.php(111): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->execute()
#8 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch()
#9 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->___callParent()
#10 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->Magento\Framework\Interception\{closure}()
#11 /var/www/html/mg24/magento2/generated/code/Magento/CatalogSearch/Controller/Advanced/Result/Interceptor.php(32): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->___callPlugins()
#12 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(245): Magento\CatalogSearch\Controller\Advanced\Result\Interceptor->dispatch()
#13 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(212): Magento\Framework\App\FrontController->getActionResponse()
#14 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/FrontController.php(147): Magento\Framework\App\FrontController->processRequest()
#15 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch()
#16 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent()
#17 /var/www/html/mg24/magento2/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php(99): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#18 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch()
#19 /var/www/html/mg24/magento2/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php(75): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#20 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(135): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch()
#21 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}()
#22 /var/www/html/mg24/magento2/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins()
#23 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch()
#24 /var/www/html/mg24/magento2/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch()
#25 /var/www/html/mg24/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(264): Magento\Framework\App\Http\Interceptor->launch()
#26 /var/www/html/mg24/magento2/pub/index.php(30): Magento\Framework\App\Bootstrap->run()
#27 {main} {"report_id":"a4896b6ef63c77f8d3ed38c58ef08f57836f8cf479917c986425a700daebd851"} []
---
Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

- [ ] Severity: S0 _- Affects critical data or functionality and leaves users without workaround._
- [ ] Severity: S1 _- Affects critical data or functionality and forces users to employ a workaround._
- [ ] Severity: S2 _- Affects non-critical data or functionality and forces users to employ a workaround._
- [X] Severity: S3 _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: S4 _- Affects aesthetics, professional look and feel, “quality” or “usability”._

Taken from the upstream issue.

Error signatures

Code match per tag

Each tag was checked with git apply --check against that tag's files. A clean match means the change applies; it is not a test result. Tags that already contain the fix are marked.

LineCode match per tagTests
2.4.6
2.4.6 clean 2.4.6-p1 clean 2.4.6-p2 clean 2.4.6-p3 clean 2.4.6-p4 clean 2.4.6-p5 clean 2.4.6-p6 clean 2.4.6-p7 clean 2.4.6-p8 clean 2.4.6-p9 clean 2.4.6-p10 clean 2.4.6-p11 clean 2.4.6-p12 clean 2.4.6-p13 clean 2.4.6-p14 clean 2.4.6-p15 clean
2.4.6: no test data 2.4.6-p1: no test data 2.4.6-p2: no test data 2.4.6-p3: no test data 2.4.6-p4: no test data 2.4.6-p5: no test data 2.4.6-p6: no test data 2.4.6-p7: no test data 2.4.6-p8: no test data 2.4.6-p9: no test data 2.4.6-p10: no test data 2.4.6-p11: no test data 2.4.6-p12: no test data 2.4.6-p13: no test data 2.4.6-p14: no test data 2.4.6-p15: no test data
2.4.7
2.4.7 clean 2.4.7-p1 clean 2.4.7-p2 clean 2.4.7-p3 clean 2.4.7-p4 clean 2.4.7-p5 clean 2.4.7-p6 clean 2.4.7-p7 clean 2.4.7-p8 clean 2.4.7-p9 clean 2.4.7-p10 clean
2.4.7: no test data 2.4.7-p1: no test data 2.4.7-p2: no test data 2.4.7-p3: no test data 2.4.7-p4: no test data 2.4.7-p5: no test data 2.4.7-p6: no test data 2.4.7-p7: no test data 2.4.7-p8: no test data 2.4.7-p9: no test data 2.4.7-p10: test files do not apply to this releaseunit: could not run before, could not run after
2.4.8
2.4.8 clean 2.4.8-p1 clean 2.4.8-p2 clean 2.4.8-p3 clean 2.4.8-p4 clean 2.4.8-p5 clean
2.4.8: no test data 2.4.8-p1: no test data 2.4.8-p2: no test data 2.4.8-p3: no test data 2.4.8-p4: no test data 2.4.8-p5: test could not run before the patch, passes afterunit: could not run before, passes after
2.4.9
2.4.9 clean
2.4.9: test could not run before the patch, passes afterunit: could not run before, passes after

Triage

Model @cf/cloudflare/clef. Probability this is a bug fix: 97.6%. Probability it is security relevant: 0.6%.

Show the model's answers and probabilities
QuestionAnswerProbabilitiesConfidence
Change kindbugfixbugfix 97.5%, refactor 0.8%, tests_only 0.6%, feature 0.5%, dependency 0.3%, docs_only 0.3%94.2%
Areacatalogcatalog 74.8%, other 8.3%, frontend 6.2%51.3%
Reported version2.4.22.4.2 60.6%, 2.4.2-p2 6.7%, 2.4.2-p1 6.3%36.9%
Scope0.59 of 20 47.5%, 1 45.8%, 2 6.8%15.9%
Risk0.16 of 20 86.5%, 1 11.3%, 2 2.3%64.1%
Worth backporting1.73 of 22 77.4%, 1 17.9%, 0 4.7%44.9%

Download

For cweagans/composer-patches, choose a version below and download the bundle. Copy its magento2-40422/ folder into patches/composer/, merge composer.patches.json into composer.json, then run composer install. Test files are always removed; paths are relative to each package root, using the default -p1 level.

Packages (1): magento/module-catalog-search
Bundle README (what the ZIP ships)
# magento2-40422

Community fix merged upstream into magento/magento2, adapted by magento.watch.
This is not a patch published by Adobe.

Pull request: https://github.com/magento/magento2/pull/40422
Issue: https://github.com/magento/magento2/issues/33588
Author: @KrasnoshchokBohdan
Source commit: fe4605d1193a74f3724636633d00b471716f103f
Modifications: test files and documentation removed, paths rewritten relative to each Composer package.
Licence: OSL-3.0 / AFL-3.0, as the original Magento Open Source code.
Maintainer: Łukasz Bajsarowicz (@lbajsarowicz)

Licence: Magento Open Source code under OSL-3.0 and AFL-3.0. The bundle carries the original author, source commit and the list of modifications.

Sources

Łukasz Bajsarowicz
Built by

Łukasz Bajsarowicz, e-commerce architect

Magento and Adobe Commerce architecture, upgrades, performance and audits for merchants and agencies since 2015; magento.watch is the tooling I use on those projects.

Open source, maintained on weekends.