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

Customer export not work with custom attribute #14495

Closed
nans opened this issue Apr 2, 2018 · 7 comments · Fixed by #36663
Closed

Customer export not work with custom attribute #14495

nans opened this issue Apr 2, 2018 · 7 comments · Fixed by #36663
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@nans
Copy link

nans commented Apr 2, 2018

Preconditions

Version 2.0.18:
php 5.6 & 7.0;
Mysql Ver 14.14 Distrib 5.1.73;

Version 2.1.12:
php 5.6 & 7.0;
Mysql Ver 14.14 Distrib 5.1.73;

Version 2.2.3:
php 7.0 & 7.1;
Mysql Ver 14.14 Distrib 5.1.73;

Version 2.3.0-dev:
php 7.0 & 7.1;
Mysql Ver 14.14 Distrib 5.1.73;

Steps to reproduce

  1. Create customer custom attribute with type int like there
  2. Add field to customer grid by customer_listing.xml
  3. Create customers (2 or more) with new attributes (check table customer_entity_int on records);
  4. Try to export
    4.1 Do not check customer ids checkboxes and press on button Export -> CSV -> Export
    Actual result: bug
    Expected result: csv file with data
    4.2 Select some customers and press on button Export -> CSV -> Export
    Actual result: bug
    Expected result: csv file with data
    4.3 Choose all customers and press on button Export -> CSV -> Export
    Actual result: csv file with data;
    Expected result: csv file with data

Bug reports

ver. 2.0.18
ver. 2.1.12
ver. 2.2.3
ver. 2.3.0-dev

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Apr 2, 2018
@ghost ghost self-assigned this Jul 17, 2018
@ghost
Copy link

ghost commented Jul 18, 2018

@nans, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

@ghost ghost closed this as completed Jul 18, 2018
@joachimVT
Copy link

joachimVT commented Jun 20, 2019

Working on magento 2.2.7
This issue should be reopened I am having the exact same erorr as @nans after adding extra fields to customer grid by adding customer_listing.xml

When Choosing all customers and press on button Export -> CSV -> Export
Actual result: csv file with data;
Expected result: csv file with data

When you don't check any checkbox it gives the following issue:

Schermafbeelding 2019-06-20 om 17 27 24

@joachimVT joachimVT reopened this Jun 20, 2019
@ghost ghost removed their assignment Jun 20, 2019
@engcom-Charlie engcom-Charlie self-assigned this Jun 20, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jun 20, 2019

Hi @engcom-Charlie. 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: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@engcom-Charlie
Copy link
Contributor

Hello @nans !
I can not reproduce your issue. The GitHub issue tracker is intended for Magento Core technical issues only. Please refer to the Community Forums or the Magento Stack Exchange, for advice or general discussion about this issue.

@daiduongvo18
Copy link

I can reproduce the issue on Magento 2.4.1 as @nans mentioned.

Steps to reproduce:

  1. Add new customer attribute whose code is varchar_attribute, Input Type => Text Field, Add to Column Options => Yes, Use in Filter Options => Yes.

  2. Define the varchar_attribute in the customer_listing.xml as in this sample module
    TestCompany.zip

  3. Flush cache and reindex customer_grid in order to create the varchar_attribute in the table customer_grid_flat.

  4. Export the customer data at the Customer listing page.

Expected result:
Can download the CSV file.

Actual result:

TypeError: Argument 2 passed to Magento\Framework\View\Element\UiComponentFactory::argumentsResolver() must be of the type array, null given, called in /app/vendor/magento/framework/View/Element/UiComponentFactory.php on line 235 and defined in /app/vendor/magento/framework/View/Element/UiComponentFactory.php:183 Stack trace: #0 /app/vendor/magento/framework/View/Element/UiComponentFactory.php(235): Magento\Framework\View\Element\UiComponentFactory->argumentsResolver('varchar_attribu...', NULL) #1 /app/vendor/magento/module-ui/Component/Listing/Columns/Column.php(78): Magento\Framework\View\Element\UiComponentFactory->create('varchar_attribu...', 'varchar', Array) #2 /app/app/code/TestCompany/TestModule/UiComponent/Listing/VarcharAttribute.php(16): Magento\Ui\Component\Listing\Columns\Column->prepare() #3 /app/vendor/magento/module-ui/Component/MassAction/Filter.php(190): TestCompany\TestModule\UiComponent\Listing\VarcharAttribute->prepare() #4 /app/vendor/magento/module-ui/Component/MassAction/Filter.php(188): Magento\Ui\Component\MassAction\Filter->prepareComponent(Object(TestCompany\TestModule\UiComponent\Listing\VarcharAttribute)) #5 /app/vendor/magento/module-ui/Component/MassAction/Filter.php(188): Magento\Ui\Component\MassAction\Filter->prepareComponent(Object(Magento\Customer\Ui\Component\Listing\Columns)) #6 /app/vendor/magento/module-ui/Component/MassAction/Filter.php(213): Magento\Ui\Component\MassAction\Filter->prepareComponent(Object(Magento\Ui\Component\Listing)) #7 /app/vendor/magento/module-ui/Component/MassAction/Filter.php(131): Magento\Ui\Component\MassAction\Filter->getDataProvider() #8 /app/vendor/magento/module-ui/Model/Export/ConvertToCsv.php(72): Magento\Ui\Component\MassAction\Filter->applySelectionOnTargetProvider() #9 /app/vendor/magento/module-ui/Controller/Adminhtml/Export/GridToCsv.php(70): Magento\Ui\Model\Export\ConvertToCsv->getCsvFile() #10 /app/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Ui\Controller\Adminhtml\Export\GridToCsv->execute() #11 /app/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent('execute', Array) #12 /app/vendor/magento/framework/App/Action/Plugin/ActionFlagNoDispatchPlugin.php(51): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}() #13 /app/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Framework\App\Action\Plugin\ActionFlagNoDispatchPlugin->aroundExecute(Object(Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor), Object(Closure)) #14 /app/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}() #15 /app/generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php(23): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins('execute', Array, Array) #16 /app/vendor/magento/framework/App/Action/Action.php(111): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->execute() #17 /app/vendor/magento/module-backend/App/AbstractAction.php(151): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #18 /app/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http)) #19 /app/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callParent('dispatch', Array) #20 /app/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #21 /app/vendor/magento/framework/Interception/Interceptor.php(135): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http)) #22 /app/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #23 /app/generated/code/Magento/Ui/Controller/Adminhtml/Export/GridToCsv/Interceptor.php(32): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->___callPlugins('dispatch', Array, Array) #24 /app/vendor/magento/framework/App/FrontController.php(186): Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #25 /app/vendor/magento/framework/App/FrontController.php(118): Magento\Framework\App\FrontController->processRequest(Object(Magento\Framework\App\Request\Http), Object(Magento\Ui\Controller\Adminhtml\Export\GridToCsv\Interceptor)) #26 /app/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http)) #27 /app/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array) #28 /app/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http)) #29 /app/generated/code/Magento/Framework/App/FrontController/Interceptor.php(23): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array) #30 /app/vendor/magento/framework/App/Http.php(116): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) #31 /app/generated/code/Magento/Framework/App/Http/Interceptor.php(23): Magento\Framework\App\Http->launch() #32 /app/vendor/magento/framework/App/Bootstrap.php(263): Magento\Framework\App\Http\Interceptor->launch() #33 /app/pub/index.php(40): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor)) #34 {main}

ksnip_20210914-173406

Root cause:

The root cause is the code at the line https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/Ui/Component/Listing/Columns.php#L161. It is getting the dataType from the backend type of the attribute while in this line https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Customer/Ui/Component/ColumnFactory.php#L74 it is create new column with dataType from the frontend input of the attribute. In my case, a component is added for the varchar_attribute with the dataType=varchar. varchar is not a valid UI component type.

I think dataType of the component should be frontend input because frontend input exists in the component types in https://github.com/magento/magento2/blob/2.4-develop/app/code/Magento/Ui/view/base/ui_component/etc/definition.xml.

Although we need custom code to reproduce the issue, the root cause belongs to Magento Core.

@evolbug
Copy link

evolbug commented Mar 30, 2022

This is still an issue in Magento 2.4.3-p1, please reopen

amenk added a commit to amenk/magento2 that referenced this issue Dec 22, 2022
* As described in the issue, it does not make sense to use the backend-type for the UI-component data type, because those do not exist necessarily
* Changed it to frontend_input
@amenk
Copy link
Contributor

amenk commented Dec 22, 2022

Still an issue in 2.4.4-p2, I submitted a PR #36663

amenk added a commit to amenk/magento2 that referenced this issue Dec 25, 2022
@engcom-Charlie engcom-Charlie removed their assignment Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants