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

Improve Errormessage #82

Closed
piotrekkaminski opened this issue Jan 3, 2018 · 7 comments
Closed

Improve Errormessage #82

piotrekkaminski opened this issue Jan 3, 2018 · 7 comments
Assignees
Milestone

Comments

@piotrekkaminski
Copy link
Contributor

piotrekkaminski commented Jan 3, 2018

From @brosenberger on October 30, 2017 10:53

Preconditions

  1. Misconfigured product update within UpgradeData-Script:
$eavSetup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, 'pim_option_1', [
...
    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_WEBSITE,
...
]);

Steps to reproduce

  1. Create a correct product import csv for a configurable product including some references within the configuration_variants column
  2. go to admin-backend/system/import
  3. choose products to import with above created import file
  4. press validate data button

Expected result

  1. validation erros shows up with a more specific message like 'Attribute with code must be global and is not super in row(s)'
  2. see https://magento.stackexchange.com/questions/139630/attribute-with-this-code-is-not-super-in-row-magento-2

Actual result

  1. validation error shows up with message: Attribute with this code is not super in row(s)

Copied from original issue: magento/magento2#11871

@piotrekkaminski
Copy link
Contributor Author

From @orlangur on October 30, 2017 12:6

must be global and is not super in row(s)

Such message has no sense as every global select is considered to be super by design:

// save super attributes for simplier and quicker search in future
        if ('select' == $attrParams['type'] && 1 == $attrParams['is_global']) {
            $this->_superAttributes[$attrParams['code']] = $attrParams;
        }

However, check for is_global could be implemented as separate with separate error message.

@piotrekkaminski
Copy link
Contributor Author

From @magento-engcom-team on November 17, 2017 10:30

@brosenberger, thank you for your report.
We've created internal ticket(s) MAGETWO-84059 to track progress on the issue.

@tadhgbowe
Copy link

@piotrekkaminski - I've reviewed this.

TESTED ON [Magento Commerce 2.2.2] and [2.3-develop]

If the import detects that a configurable_variations attribute code is not super the following checks are needed:

  1. Check attribute exists.
  2. Check that it has a Catalog Input Type of "Dropdown", "Visual Swatch" or Text Swatch"
  3. Check that it has a Scope of "Global".
  4. Check that it exists in required Attribute Set.

At the moment we only have a check to see if the attribute is in the list of super attributes:

if (!$this->_isAttributeSuper($superAttrCode)) { FAIL - DISPLAY ERROR }

Is the intended result:

  1. to try pinpoint exactly which one(s) of the above the attribute has failed on? That will require extra coding. I'm not sure all the information is available at that moment in time.

  2. to simply expand the message to alert the user of all possible reasons why.

Thanks,
Tadhg

@piotrekkaminski
Copy link
Contributor Author

I'd prefer detailed message when available, when not a list of possible reasons. The easier we can make it for people to avoid looking at CSV trying to guess what's wrong, the better.

@tadhgbowe
Copy link

@piotrekkaminski - Agreed. It's on my radar. Thanks. T

@tadhgbowe
Copy link

Quick update from me:

If the import detects that a configurable_variations attribute code is not super one the following error messages will be displayed:

Attribute code does not exist or is not in chosen attribute set.
Attribute code needs to have an Input Type of "Dropdown", "Visual Swatch" or Text Swatch"
Attribute code needs to have a Scope of "Global".

This covers all reasons why is not super. I will submit a pull request early next week for this.

Thanks. T.

tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jun 28, 2018
…s - not a super attribute error message improvements
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jun 28, 2018
…s - not a super attribute error message improvements - travis ci build code fix
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jun 29, 2018
…s - not a super attribute error message improvements - travis ci build code style fix
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jun 29, 2018
…s - not a super attribute error message improvements - travis ci build code style fixes
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jul 6, 2018
…s - not a super attribute error message improvements - code styling fixes
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jul 6, 2018
…s - not a super attribute error message improvements - code styling Travis CI build fixes
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jul 7, 2018
…s - not a super attribute error message improvements - code styling Travis CI build fixes
tadhgbowe pushed a commit to tadhgbowe/import-export-improvements that referenced this issue Jul 7, 2018
…s - not a super attribute error message improvements - code styling Travis CI build fixes
magento-engcom-team added a commit that referenced this issue Jul 21, 2018
…essage improvements #115

 - Merge Pull Request #115 from tadhgbowe/import-export-improvements:import-export-issue-82-error-messaging
 - Merged commits:
   1. e99c99e
   2. 65bce0a
   3. 7f9f6db
   4. a76e3a3
   5. 3a0599d
   6. 6a5b15d
   7. b98f417
   8. 8db836b
magento-engcom-team pushed a commit that referenced this issue Jul 21, 2018
magento-engcom-team pushed a commit that referenced this issue Jul 21, 2018
Accepted Public Pull Requests:
 - magento/magento2#16961: [Forwardport] Improve "Invalid country code" error message on tax import (by @ihor-sviziev)
 - magento/magento2#16962: [Forwardport] Add Confirm Modal Width (by @ihor-sviziev)
 - magento/magento2#16769: [Forwardport] Added 'title' attribute to 'img' tag in knockout template files. (by @sanganinamrata)
 - magento/magento2#16947: [Forwardport] Fix newsletter subscription behaviour for registered customer.  (by @eduard13)
 - magento/magento2#16876: FIXED: FTP user and password strings urldecoded (by @javierperezm)
 - magento/magento2#16875: Remove unused comments from _initDiscount() function (by @mageprince)
 - magento/magento2#16888: Code improvement (by @mage2pratik)
 - magento/magento2#16892: [Forwardport] Fix for #12081: missing translations in the js-translations.json (by @mage2pratik)
 - #115: import-export-improvements #82 : super attribute error message improvements (by @tadhgbowe)


Fixed GitHub Issues:
 - magento/magento2#12081: Magento 2.2.0: Translations for 'Item in Cart' missing in mini cart. (reported by @jhruehl) has been fixed in magento/magento2#16892 by @mage2pratik in 2.3-develop branch
   Related commits:
     1. 18d11f5
@dmanners
Copy link
Contributor

dmanners commented Jul 23, 2018

Thank you @tadhgbowe for your fix for this issue. PR #115 has added more detailed information to error messages here.

magento-engcom-team pushed a commit that referenced this issue Aug 26, 2018
Merge 2.3-develop to EPAM-PR-4
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants