Skip to content

Grid export issue task 25963 #26046

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

Conversation

konarshankar07
Copy link
Contributor

@konarshankar07 konarshankar07 commented Dec 14, 2019

Description (*)

This PR will fix the customer_group column data is not reflected in the exported CSV

Fixed Issues (if relevant)

  1. Grid Export rendered data is not reflecting in the exported File, Displayed ID instead of Rendered Label #25963: Grid Export rendered data is not reflecting in the exported File, Displayed ID instead of Rendered Label

Manual testing scenarios (*)

  1. Log in to the Magento Admin
  2. Click "sales" from the menu on the left
  3. Click "order"
  4. Click on Export
  5. Select CSV/Excel XML

Expected Result

image

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Dec 14, 2019

Hi @konarshankar07. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

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

@konarshankar07
Copy link
Contributor Author

konarshankar07 commented Dec 15, 2019

I found that we can reuse the Magento\Sales\Ui\Component\DataProvider\Document class instead of creating new Magento\Sales\Ui\Component\DataProvider\Order\Document which is introduced in this PR because I think it violates DRY principle. We need to name the column for the customer_group_id needs to be same for whole application I found some inconsistency in sales_order_grid and sales_invoice_grid tables.

@novikor novikor self-requested a review January 23, 2020 15:29
@novikor novikor self-assigned this Jan 23, 2020
@novikor
Copy link
Contributor

novikor commented Jan 23, 2020

Hi, @konarshankar07. Thank you for your contribution.
The problem is reproduced globally while exporting any grid, even custom.

Could you please investigate for a more universal solution?
I am going to check it as well.

Copy link
Contributor

@novikor novikor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest taking a look at \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult.
Also $document can be moved to the constructor to create a possibility to provide it via di.xml for extensibility purposes.

Moreover, it is OK to modify \Magento\Framework\View\Element\UiComponent\DataProvider\Document directly if needed.

@konarshankar07
Copy link
Contributor Author

@novikor ... Thanks for the feedback. I'll try to find the universal solution for this issue

@novikor
Copy link
Contributor

novikor commented Jan 24, 2020

@konarshankar07, - If we fail to find the universal solution, the current one is OK as well.
As far as I can see, similar problems for other grids are fixed this way.

Please let me know if you feel some trouble about that and would like to give up :)

@novikor
Copy link
Contributor

novikor commented Jan 24, 2020

Hi, @konarshankar07 !
Well, I dug too deep and created my own PR: #26523

It seems that I cannot review this PR anymore since I am an interested person.
I`ll request @swnsma 's review.

@novikor
Copy link
Contributor

novikor commented Jan 27, 2020

Hi, @konarshankar07 . Please fix the static tests.

@konarshankar07
Copy link
Contributor Author

Hello @novikor ,
Sorry for the delay. Sure, I'll fix the static test but did you find any universal solution for this issue?
Thanks

Copy link
Contributor

@lbajsarowicz lbajsarowicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed few things to change

/**
* @var string
*/
private static $customerGroupAttributeCode = 'customer_group';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use private const CUSTOMER_GROUP_ATTRIBUTE_CODE instead.

/**
* Class Document
*/
class Document extends \Magento\Framework\View\Element\UiComponent\DataProvider\Document
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import class with alias.

@ghost ghost assigned lbajsarowicz Jan 27, 2020
@novikor
Copy link
Contributor

novikor commented Jan 31, 2020

Hello @novikor ,
Sorry for the delay. Sure, I'll fix the static test but did you find any universal solution for this issue?

Hi. Yes, - it is #26523
So, I afraid current PR is not needed anymore if my one is approved, - despite it is newer than yours.
@lbajsarowicz , what do you think?

@m2-assistant
Copy link

m2-assistant bot commented Feb 22, 2020

Hi @konarshankar07, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@konarshankar07 konarshankar07 deleted the grid-export-issue--task-25963 branch February 22, 2020 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants