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

[Backport]-issue-195196 Can't upload customer Image attribute programmatically #21437

Merged
merged 2 commits into from
Mar 1, 2019
Merged

Conversation

Nazar65
Copy link
Member

@Nazar65 Nazar65 commented Feb 25, 2019

Original PR #19988

Description (*)

Could not load image for customer attribute, error: Base64 is not defined "

Fixed Issues (if relevant)

  1. Can't work customer Image attribute programmatically #19983: Could not load image for customer attribute,

Manual testing scenarios (*)

1-Create customer attribute type file ->

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            \Magento\Customer\Model\Customer::ENTITY,
            'sample_attribute2',
            [
                'type'         => 'text',
                'label'        => 'Sample Attribute',
                'input'        => 'file',
                'required'     => false,
                'visible'      => true,
                'user_defined' => false,
                'position'     => 999,
                'system'       => 0,
            ]
        );
        $sampleAttribute = $this->eavConfig->getAttribute(Customer::ENTITY, 'sample_attribute');

        // more used_in_forms ['adminhtml_checkout','adminhtml_customer','adminhtml_customer_address','customer_account_edit','customer_address_edit','customer_register_address']
        $sampleAttribute->setData(
            'used_in_forms',
            ['adminhtml_customer','customer_register_address','customer_address_edit','customer_account_edit']

        );
        $sampleAttribute->save();

2. try to upload image on adminhtml customer edit.

Expected Result

No errors in Console, Image uploaded

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)

@magento-engcom-team
Copy link
Contributor

Hi @Nazar65. 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.2-develop instance - deploy vanilla Magento instance

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

@Nazar65 Nazar65 requested a review from sivaschenko February 25, 2019 12:03
@Nazar65 Nazar65 changed the title Backport-issue-195196 [Backport]-issue-195196 Can't upload customer Image attribute programmatically Feb 25, 2019
@orlangur orlangur self-assigned this Feb 25, 2019
@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, thank you for the review.
ENGCOM-4366 has been created to process this Pull Request

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

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

Hi @Nazar65 thanks for the backport, during testing, we discovered there is a JS error when creating a new customer in the admin panel on the PR code base, can you please check that.

image

@sivaschenko
Copy link
Member

@magento-engcom-team give me test instance

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko. Thank you for your request. I'm working on Magento instance for you

@magento-engcom-team
Copy link
Contributor

Hi @sivaschenko, here is your new Magento instance.
Admin access: https://pr-21437.instances.magento-community.engineering/admin
Login: admin Password: 123123q

@sivaschenko
Copy link
Member

@Nazar65 sorry, I don't think your last commit was included during testing, we'll recheck including the last commit

@ghost
Copy link

ghost commented Mar 1, 2019

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

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