Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX #11022 in 2.2-develop: Filter Groups of search criteria parameter have not been included for further processing #11421

Merged

Conversation

davidverholen
Copy link
Member

@davidverholen davidverholen commented Oct 13, 2017

Description

The Filter Groups and the Sort Order of the $searchCriteria parameter have not been included in the searchCriteria Object that is finally provided for the eav set repository.

This Pull request sets the filtergroups and sort order in the searchCriteriaBuilder

Fixed Issues (if relevant)

  1. GET v1/products/attribute-sets/sets/list inconsistent return result #11022: GET v1/products/attribute-sets/sets/list inconsistent return result

Manual testing scenarios

  1. Create an additional product attribute set
  2. call to GET http://URL/rest/v1/products/attribute-sets/sets/list?searchCriteria[filter_groups][0][filters][0][field]=attribute_set_name&searchCriteria[filter_groups][0][filters][0][condition_type]=eq&searchCriteria[filter_groups][0][filters][0][value]=default
  3. Result should be only the default attribute set (before it always returned all product attribute sets)

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

//cc @dmanners

@dmanners dmanners self-assigned this Oct 13, 2017
@dmanners dmanners added Release Line: 2.2 Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog SQUASHTOBERFEST labels Oct 13, 2017
@dmanners dmanners added this to the October 2017 milestone Oct 13, 2017
@dmanners dmanners added 2.2.x Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release and removed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release labels Oct 13, 2017
@dmanners
Copy link
Contributor

Hi @davidverholen just to keep you updated with this PR. The code causes an issue with the swagger implementation. If you try to run the api call via swagger you end up getting the following error.

{
  "message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause', query was: SELECT `main_table`.* FROM `eav_attribute_set` AS `main_table` WHERE ((`attribute_set_name` = '')) AND ((`` = 'Defaualt')) AND ((`` = '')) AND (`entity_type_id` = '4')",
  "code": 42,
  "trace": "#0 /var/www/html/magento2ce/lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array)\n#1 /var/www/html/magento2ce/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\\Framework\\DB\\Statement\\Pdo\\Mysql->_execute(Array)\n#2 /var/www/html/magento2ce/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)\n#3 /var/www/html/magento2ce/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)\n#4 /var/www/html/magento2ce/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(517): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)\n#5 /var/www/html/magento2ce/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php(580): Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->_query('SELECT `main_ta...', Array)\n#6 /var/www/html/magento2ce/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\\Framework\\DB\\Adapter\\Pdo\\Mysql->query(Object(Magento\\Framework\\DB\\Select), Array)\n#7 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\\Framework\\DB\\Select), Array)\n#8 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(774): Magento\\Framework\\Data\\Collection\\Db\\FetchStrategy\\Query->fetchAll(Object(Magento\\Framework\\DB\\Select), Array)\n#9 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(670): Magento\\Framework\\Data\\Collection\\AbstractDb->_fetchAll(Object(Magento\\Framework\\DB\\Select))\n#10 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(574): Magento\\Framework\\Data\\Collection\\AbstractDb->getData()\n#11 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection/AbstractDb.php(559): Magento\\Framework\\Data\\Collection\\AbstractDb->loadWithFilter(false, false)\n#12 /var/www/html/magento2ce/lib/internal/Magento/Framework/Data/Collection.php(331): Magento\\Framework\\Data\\Collection\\AbstractDb->load()\n#13 /var/www/html/magento2ce/app/code/Magento/Eav/Model/AttributeSetRepository.php(115): Magento\\Framework\\Data\\Collection->getItems()\n#14 /var/www/html/magento2ce/app/code/Magento/Catalog/Model/Product/Attribute/SetRepository.php(80): Magento\\Eav\\Model\\AttributeSetRepository->getList(Object(Magento\\Framework\\Api\\SearchCriteria))\n#15 [internal function]: Magento\\Catalog\\Model\\Product\\Attribute\\SetRepository->getList(Object(Magento\\Framework\\Api\\SearchCriteria))\n#16 /var/www/html/magento2ce/app/code/Magento/Webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)\n#17 /var/www/html/magento2ce/app/code/Magento/Webapi/Controller/Rest.php(239): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#18 /var/www/html/magento2ce/lib/internal/Magento/Framework/Interception/Interceptor.php(58): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#19 /var/www/html/magento2ce/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callParent('dispatch', Array)\n#20 /var/www/html/magento2ce/lib/internal/Magento/Framework/Interception/Interceptor.php(153): Magento\\Webapi\\Controller\\Rest\\Interceptor->Magento\\Framework\\Interception\\{closure}(Object(Magento\\Framework\\App\\Request\\Http))\n#21 /var/www/html/magento2ce/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39): Magento\\Webapi\\Controller\\Rest\\Interceptor->___callPlugins('dispatch', Array, Array)\n#22 /var/www/html/magento2ce/lib/internal/Magento/Framework/App/Http.php(135): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#23 /var/www/html/magento2ce/lib/internal/Magento/Framework/App/Bootstrap.php(256): Magento\\Framework\\App\\Http->launch()\n#24 /var/www/html/magento2ce/pub/index.php(37): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#25 {main}"
}

I will investigate this and try to fix this issue for you.

@dmanners
Copy link
Contributor

The problem is not with the changes you have made but with how swagger and the search criteria works or better to say does not work. More information can be found in #11477

@magento-team magento-team merged commit 3ec56ac into magento:2.2-develop Oct 26, 2017
magento-team pushed a commit that referenced this pull request Oct 26, 2017
…teria parameter have not been included for further processing #11421
magento-team pushed a commit that referenced this pull request Oct 26, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-82724 Allow coupon code with special charater to be applied to order in checkout #11710
 - MAGETWO-82675 Add a health check to the NGINX configuration sample #11690
 - MAGETWO-82562 Coupon codes not showing in invoice #11635
 - MAGETWO-82535 Fixed ability to set field config from layout xml #11302 [backport 2.2] #11643
 - MAGETWO-81146 Fixing #10275 keyboard submit of adminhtml suggest form. #11250
 - MAGETWO-82761 [Backport 2.2-develop] Dashboard Fix Y Axis for range #11751
 - MAGETWO-82748 Fix Notice: freePackageValue is undefined #11720
 - MAGETWO-82747 [TASK] Updated user.ini according to Magento DevDocs #11734
 - MAGETWO-82537 MAGETWO-81311: Check the length of the array before attempting to sli… #11637
 - MAGETWO-81970 Add missing translations in Magento_UI #11440
 - MAGETWO-81904 FIX #11022 in 2.2-develop: Filter Groups of search criteria parameter have not been included for further processing #11421
 - MAGETWO-82179 Fix Filter Customer Report Review 2.2-develop [Backport] #11522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Framework/Webapi USE ONLY for FRAMEWORK RELATED BUG! E.g If bug related to Catalog WEB API use just Catalog Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants