Skip to content
This repository has been archived by the owner on Apr 29, 2019. It is now read-only.

[MAGETWO-1556] Export: Unable to Filter Data by Attribute With Input … #98

Merged

Conversation

php4umagento
Copy link
Contributor

@php4umagento php4umagento commented Jan 17, 2018

…Type Multiple Select

  • added support for multiselect attribute for both product and customer entity

Description

Fixed Issues (if relevant)

  1. [MAGETWO-1556] Export: Unable to Filter Data by Attribute With Input Type Multiple Select #33: [MAGETWO-1556] Export: Unable to Filter Data by Attribute With Input Type Multiple Select

Manual testing scenarios

  1. Add multiselect attribute to customer entity
  2. Populate data for that newly created attribute
  3. Go to Import/Export and select Customer Main data
  4. Observe that multiselect attributes are presented as multiselect form field
  5. Data is filtered by selected values

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)

@dmanners
Copy link
Contributor

Hey @php4umagento it overall looks good. Now that it is working I would see this as a good opportunity to refactor and tidy the code up a bit. For example the current static tests complain about The method getAttributeFilterType() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10. https://travis-ci.org/magento-engcom/import-export-improvements/jobs/330107223 I know this is not your fault but it would be great if we could some how sort this issue.

Other than that it looks great.

@dmanners dmanners self-assigned this Jan 23, 2018
@dmanners dmanners added this to the January 2018 milestone Jan 23, 2018
@magento-engcom-team
Copy link
Contributor

@php4umagento thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@dmanners
Copy link
Contributor

Code wise this is looking good to me @php4umagento I will run this through our internal tools and the QA team and see if anything else comes up.

/**
* @var array
*/
public static $backendTypeToFilterMapper = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any current need for these to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed to protected

@php4umagento
Copy link
Contributor Author

@dmanners is there anything else for me here?

@dmanners
Copy link
Contributor

dmanners commented Feb 1, 2018

@php4umagento just that we do not encourage protected visibility could we make that a change?

@php4umagento
Copy link
Contributor Author

build is running now with "private" scope

@php4umagento
Copy link
Contributor Author

@dmanners done

@dmanners
Copy link
Contributor

dmanners commented Feb 2, 2018

Thanks @php4umagento I will get this PR into the process loop now and see if we can sort some QA out for this task.

@magento-engcom-team
Copy link
Contributor

@php4umagento thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@dmanners
Copy link
Contributor

Hi @php4umagento during testing the QA team validated the customer section is fixed but would it also be possible to fix the product filter part as well?

Steps to reproduce

1) Create product attribute with type multiselect and add to attribute set.
2) Create several product with created attribute.
3) Go to Export and select Products
4) Observe that multiselect attributes are presented as multiselect form field
5) Select multiselect attribute and any option in filter
6) Press "Continue" button
 Expected result
   - Data is filtered by selected option.
 Actual result
   - Exported all products, not looking at the filter.

php4umagento and others added 6 commits February 26, 2018 15:20
…Type Multiple Select

 - added support for multiselect attribute for both product and customer entity
…e Multiple Select

     - reduced complexity of getAttributeFilterType method
…e Multiple Select

Changed variable scope to be protected
…e Multiple Select

    Changed variable scope to be private
…uct export

 - make sure that the abstract entity class knows how to deal with multi select attributes
 - add finset attribute filter when type matches \Magento\ImportExport\Model\Export::FILTER_TYPE_MULTISELECT
@dmanners
Copy link
Contributor

@php4umagento

Preconditions

There is a custom attribute created with input type Multiple Select, 3 options enabled ("Option 1", "Option 2", "Option 3").
There is a customer in the system created with custom attribute value = "Option 1" and second customer in the system created with custom attribute value = "Option 2".
Steps to reproduce

Go to System-> Import/Export-> Export at backend.
Select "Customers" entity type.
In the grid for attribute from precondition select "Option 1" and "Option 2" filter.
Press "Continue" button.
 Expected Result
The file was exported with customers from precondition.

 Actual Result
File was not exported.
The error message appears "There is no data for export".
 The same behavior with products.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants