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

Fixed #20943 No complete validation while creation of attributes. #20941

Closed

Conversation

pankaj-cedcoss
Copy link
Contributor

@pankaj-cedcoss pankaj-cedcoss commented Feb 3, 2019

Issue #20943 Fixed

Preconditions (*)

1.Magento 2.3
2.PHP 7.2

Steps to reproduce (*)

1.Create an attribute.

$eavSetup->addAttribute(
			\Magento\Catalog\Model\Product::ENTITY,
			'sample_attribute_Test##',
			[
				'type' => 'text',
				'backend' => '',
				'frontend' => '',
				'label' => 'Sample Atrribute',
				'input' => 'text',
				'class' => '',
				'source' => '',
				'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
				'visible' => true,
				'required' => true,
				'user_defined' => false,
				'default' => '',
				'searchable' => false,
				'filterable' => false,
				'comparable' => false,
				'visible_on_front' => false,
				'used_in_product_listing' => true,
				'unique' => false,
				'apply_to' => ''
			]
		);
  1. It will be created . (And it should not create since not special chars other than _ allowed).

3.Edit this attribute from admin panel , you will not allow to edit anything in this attribute due to attributeCode validations.

Expected result (*)

  1. Programatically created attribute should also be saved like other attributes.

Actual result (*)

  1. You will not able to edit sample_attribute_Test## anything due to validations.

Added validation "Please use only letters (a-z or A-Z), ', 'numbers (0-9) or underscore(_) in this field" for attribute code field
@magento-engcom-team
Copy link
Contributor

Hi @pankaj-cedcoss. 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-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@irajneeshgupta irajneeshgupta changed the title Fixed #20766 AttributeCode column name length validation throws wrong error message Fixed #20943 AttributeCode column name length validation throws wrong error message Feb 3, 2019
@irajneeshgupta irajneeshgupta changed the title Fixed #20943 AttributeCode column name length validation throws wrong error message Fixed #20943 No complete validation while creation of attributes. Feb 3, 2019
@eduard13
Copy link
Contributor

eduard13 commented Feb 3, 2019

Duplicate of #20526

@eduard13 eduard13 marked this as a duplicate of #20526 Feb 3, 2019
@dmytro-ch dmytro-ch self-requested a review February 4, 2019 20:05
@dmytro-ch dmytro-ch self-assigned this Feb 4, 2019
@dmytro-ch
Copy link
Contributor

Closing this PR as a duplicate.
Thank you!

@dmytro-ch dmytro-ch closed this Feb 4, 2019
@ghost
Copy link

ghost commented Feb 4, 2019

Hi @pankaj-cedcoss, 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.

@dmytro-ch dmytro-ch removed their request for review February 6, 2019 13:18
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