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

GetList action of the SourceItemRepository builds wrong MySQL query when filterGroup is used by searchCriteria and request is sent from Magento Swagger UI #1034

Closed
TomashKhamlai opened this issue Apr 26, 2018 · 1 comment
Assignees
Labels

Comments

@TomashKhamlai
Copy link
Contributor

TomashKhamlai commented Apr 26, 2018

Preconditions

  1. Magento with MSI
  2. One product is created and assigned to 2 or more sources.

Steps to reproduce

  1. Navigate to `/swagger/
  2. Apply the API Token inside the Swagger UI
  3. Find inventoryApiSourceItemRepositoryV1
  4. Set source_code as Field
  5. Set default as Value
  6. Set 10 as Page size
  7. Set 1 as Current page
  8. Click 'Try it out!' button

Expected result

  1. Filtered searchResult
{                                                                                                                                                                                      
   "total_count" : 1,                                                                                                                                                                                                                        
   "search_criteria" : {                                                                                                                                                                                                                     
      "page_size" : 10,
      "filter_groups" : [
         {
            "filters" : [
               {
                  "value" : "default",
                  "field" : "source_code",
                  "condition_type" : "eq"
               }
            ]
         }
      ],
      "current_page" : 1
   },
   "items" : [
      {
         "sku" : "Simple Product 1",
         "quantity" : 1000,
         "status" : 1,
         "source_code" : "default"
      }
   ]
}

Actual result

  1. Error in reports
{
  "message": "Internal Error. Details are available in Magento log file. Report ID: webapi-5ae1ce7dcb480"
}

Log file:

[2018-04-26 13:05:01] main.CRITICAL: Report ID: webapi-5ae1ce7dcb480; Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause', query was: SELECT `main_table`.* FROM `inventory_source_item` AS `main_table` WHERE ((`source_code` = '')) AND ((`` = 'default')) {"exception":"[object] (Exception(code: 42): Report ID: webapi-5ae1ce7dcb480; Message: SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause', query was: SELECT `main_table`.* FROM `inventory_source_item` AS `main_table` WHERE ((`source_code` = '')) AND ((`` = 'default')) at /var/www/html/msi/lib/internal/Magento/Framework/Webapi/ErrorProcessor.php:205, Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause', query was: SELECT `main_table`.* FROM `inventory_source_item` AS `main_table` WHERE ((`source_code` = '')) AND ((`` = 'default')) at /var/www/html/msi/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column '' in 'where clause' at /var/www/html/msi/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

caused by this query

SELECT `main_table`.* FROM `inventory_source_item` AS `main_table` WHERE ((`source_code` = '')) AND ((`` = 'default'))
@TomashKhamlai TomashKhamlai added this to the MSI Part I milestone Apr 26, 2018
@TomashKhamlai TomashKhamlai changed the title GetList action of the SourceItemRepository builds wrong MySQL query when filterGroup is used by searchCriteria GetList action of the SourceItemRepository builds wrong MySQL query when filterGroup is used by searchCriteria and request is sent from Magento Swagger UI Apr 26, 2018
@p-bystritsky p-bystritsky self-assigned this Apr 27, 2018
@p-bystritsky
Copy link
Contributor

It's Magento Core known bug magento/magento2#11477

sidolov pushed a commit that referenced this issue Nov 4, 2019
…arameters #1034

 - Merge Pull Request magento/graphql-ce#1034 from TomashKhamlai/graphql-ce:extend-data-provider-missed-params-shipping-address
 - Merged commits:
   1. 1a42940
   2. f63ab29
   3. 124384d
   4. 4464396
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants