Skip to content

Fatal error if admin enters wrong values for some customer attribute and uploads file #30963

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

Merged
merged 2 commits into from
Dec 2, 2020

Conversation

engcom-Kilo
Copy link
Contributor

@engcom-Kilo engcom-Kilo commented Nov 18, 2020

Description (*)

Related Pull Requests

https://github.com/magento/partners-magento2ee/pull/422

Fixed Issues (if relevant)

  1. Fixes Fatal error if admin enters wrong values for some customer attribute and uploads file #30295

Manual testing scenarios (*)

  1. see Fatal error if admin enters wrong values for some customer attribute and uploads file #30295

Questions or comments

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 are green)

@m2-assistant
Copy link

m2-assistant bot commented Nov 18, 2020

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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Nov 18, 2020
@engcom-Kilo engcom-Kilo changed the title MC-33687: Fatal error if admin enters wrong values for some customer attribute and uploads file Fatal error if admin enters wrong values for some customer attribute and uploads file Nov 18, 2020
@engcom-Kilo engcom-Kilo force-pushed the MC-33687 branch 7 times, most recently from 828e7d9 to a2bd7ce Compare November 23, 2020 13:56
@zakdma zakdma self-requested a review November 26, 2020 15:32
@engcom-Kilo
Copy link
Contributor Author

@magento run all tests

@engcom-Oscar engcom-Oscar added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Nov 27, 2020
@engcom-Kilo
Copy link
Contributor Author

@magento-engcom-team
Copy link
Contributor

@engcom-Kilo the branch with code successfully imported intomagento-tsg/magento2ce repository. Branch name: imported-magento-magento2-30963.

@engcom-Bravo
Copy link
Contributor

engcom-Bravo commented Nov 30, 2020

✔️ QA Passed

Manual testing scenario

  1. Go to Stores - Attributes - Customer click Add New Attribute
  2. Set the following values:
  • Default Label - New Customer Attribute
  • Attribute Code - newattcode
  • Input Type - Text Field
  • Values Required - Yes
  • Default Value - www.google.com
  • Input Validation - URL
  • Show on Storefront - Yes
  • Sort Order - 1
  1. Click Save Attribute
  2. Go Back and click Add New Attribute again
  3. Set the following values:
  • Default Label - New Customer Attribute for file
  • Attribute Code - newattcodefile
  • Input Type - File (attachment)
  • Values Required - Yes
  • Show on Storefront - Yes
  • Sort Order - 2
  1. Go to Customers - All Customers click Add New Customer
  2. Upload an image under New Attribute Code for file and fill in all the required fields. (Fname, Lname, Email)
  3. Click Save Customer

BEFORE applying changes provided in this PR
Two Exceptions appeared

2 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Something went wrong while saving the file.
Exception #1 (Magento\Framework\Exception\FileSystemException): The "/sites/mage24developee/pub/media/customer/tmp/adobe-base.jpg" file doesn't exist.

Exception #0 (Magento\Framework\Exception\LocalizedException): Something went wrong while saving the file.
<pre>#1 Magento\Customer\Model\Metadata\Form\File->processUiComponentValue() called at [app/code/Magento/Customer/Model/Metadata/Form/File.php:297]
#2 Magento\Customer\Model\Metadata\Form\File->compactValue() called at [app/code/Magento/Customer/Model/Metadata/Form.php:264]
#3 Magento\Customer\Model\Metadata\Form->compactData() called at [generated/code/Magento/Customer/Model/Metadata/Form/Interceptor.php:77]
...
#29 Magento\Framework\App\Http\Interceptor->launch() called at [lib/internal/Magento/Framework/App/Bootstrap.php:263]
#30 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29]
</pre>

Exception #1 (Magento\Framework\Exception\FileSystemException): The "/sites/mage24developee/pub/media/customer/tmp/adobe-base.jpg" file doesn't exist.
<pre>#1 Magento\Framework\Filesystem\Directory\Write->renameFile() called at [app/code/Magento/Customer/Model/FileProcessor.php:232]
#2 Magento\Customer\Model\FileProcessor->moveTemporaryFile() called at [app/code/Magento/Customer/Model/Metadata/Form/File.php:313]
#3 Magento\Customer\Model\Metadata\Form\File->processUiComponentValue() called at [app/code/Magento/Customer/Model/Metadata/Form/File.php:297]
...
#30 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#31 Magento\Framework\App\Http\Interceptor->launch() called at [lib/internal/Magento/Framework/App/Bootstrap.php:263]
#32 Magento\Framework\App\Bootstrap->run() called at [pub/index.php:29]
</pre>

AFTER switching to the PR
❌ "New Customer Attribute " is not a valid URL. message appears
not_valid_url
The Customer is created successfully if the URL is edited
On the Storefront a Please enter a valid URL. Protocol is required (http://, https:// or ftp://). message appears before the customer is created
store

@zakdma
Copy link
Contributor

zakdma commented Dec 1, 2020

@magento-engcom-team
Copy link
Contributor

@zakdma the branch with code successfully imported intomagento-tsg/magento2ce repository. Branch name: imported-magento-magento2-30963.

@magento-engcom-team magento-engcom-team merged commit 993a006 into magento:2.4-develop Dec 2, 2020
@m2-assistant
Copy link

m2-assistant bot commented Dec 2, 2020

Hi @engcom-Kilo, 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
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Component: Customer Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fatal error if admin enters wrong values for some customer attribute and uploads file
6 participants