-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fixed issue - #19346 Import data 2.2.6 Value for 'product_type' attribute contains incorrect value #19408
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
Fixed issue - #19346 Import data 2.2.6 Value for 'product_type' attribute contains incorrect value #19408
Conversation
|
Hi @GovindaSharma. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
orlangur
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fill all description fields according to template and apply code changes, then squash it into single commit and force push.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a proper check into
if ($attribute->getId() && !$attributeId) {
$message = strlen($this->getRequest()->getParam('attribute_code'))
? __('An attribute with this code already exists.')
: __('An attribute with the same code (%1) already exists.', $attributeCode);
condition, do not introduce a constant - just compare with 'product_type' string literal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so instead of introducing a constant...i should compare the string..if string is similar then throw msg right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GovindaSharma exactly, no need to overcomplicate things. When we need more than one such forbidden not-really-an-attribute, we may think about array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(strcmp($attributeCode,'product_type')==false){
$message = __('Cannot create attribute (%1) as it is already used in catalog',$attributeCode);
still not combined with first condition as requested. $attributeCode !== 'product_type' should do the trick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @orlangur
"Please fill all description fields according to template and apply code changes, then squash it into single commit and force push."
this was your feedback..i did not understand it.can you please tell me give any idea what changes i need to apply in code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GovindaSharma check this: https://github.com/magento/magento2/pull/19408/files#r236223352
You need to add new check into existing if instead of introducing a new one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GovindaSharma still not fixed
|
changes done as per request |
|
@orlangur can you please tell me what is the exact issue in first check which is not passed?i have tested the code in php 7.2 version and it's working.Please let me the exact issue so that i can fix the same |
I don't understand this question, please reword. |
|
since two checks has been passed but one is not..so what issue occurred in that checkes for which it has not been passed? |
|
@orlangur please look into the changes and let me know what other things i need to do? |
|
@magento-engcom-team and @orlangur ,can you please review the changes as i have done all necessary changes suggested by @orlangur.Let me know your feedback on this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert this change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you talking about the extra space in file? that i need to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orlangur .i made the chnages.Please review this.
Thank You.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try git checkout 2.3-develop -- app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php to get this file in correct state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@orlangur file is in correct state now.I made the changes.
|
@magento-engcom-team and @orlangur .i have done changes requested by @orlangur .Please review this and let me know. |
|
@GovindaSharma please check https://github.com/magento/magento2/pull/19408/files#r237182111. All needed changes are not done yet. |
|
@orlangur , now i have added check into existing if,previously i added extra if just to show different message because "product_type" attribute in real does not exist in magento,so that was the reason to add extra if.But now i added the checks into existing if condition.Please review the changes and let me know about it. Thank You |
|
@GovindaSharma thanks! Looks good now, please squash changes into a single commit (incuding my commits) and we are good to go. |
Added condition for validating product attribute.
|
@orlangur .I have now squash all commits into one and done force push.I think all the changes has been done now.Please check and approve the changes. |
|
Hi @orlangur, thank you for the review. |
|
@GovindaSharma thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
|
Hi @GovindaSharma. Thank you for your contribution. |
…t_type' attribute contains incorrect value #19408
|
@magento-engcom-team ,thanks for your confirmation. |
Description (*)
Fixed issue - #19346
Import data 2.2.6 Value for 'product_type' attribute contains incorrect value
Since 'product_attribute' is reserved attribute,so we can restrict this type of attribute to be created by user.
Fixed Issues (if relevant)
Fixed issue - #19346
Import data 2.2.6 Value for 'product_type' attribute contains incorrect value
Manual testing scenarios (*)
Contribution checklist (*)