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

Fixes variables in configuration fields not being replaced with actual value… #18067

Merged
merged 1 commit into from Mar 30, 2019

Conversation

hostep
Copy link
Contributor

@hostep hostep commented Sep 15, 2018

…s in the backend form fields.

Description

See #15972 for a full description

Watch out: I feel very unsecure about these changes, these should best be reviewed by someone with deep knowledge about how the configuration system works in Magento I think.
The behavior described below worked fine in Magento 2.2.0 but broke since 2.2.1, by: 86d46ce & 6c9a8b2
Maybe @viktym would be an appropriate reviewer here, since he seems to have deep knowledge about that part in the code.

It would also be awesome if tests could get added to prevent this bug from re-appearing in the future. I already attempted creating a unit test for this, but failed horribly. Any help would be appreciated!

Fixed Issues (if relevant)

  1. Since Magento 2.2.1, certain variables in the configuration get resolved to their actual value #15972: Since Magento 2.2.1, certain variables in the configuration get resolved to their actual value

Manual testing scenarios

  1. Setup a clean Magento
  2. In the backend configuration go to: General > Web > Base URLs & Base URLs (Secure)
  3. Enter {{unsecure_base_url}}media/ in "Base URL for User Media Files" and {{secure_base_url}}media/ in "Secure Base URL for User Media Files"
  4. Save Config
  5. Look at those two fields you just edited, they should remain unchanged

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 @hostep. 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 {$VERSION} instance - deploy vanilla Magento instance

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

@magento-engcom-team
Copy link
Contributor

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

@VladimirZaets
Copy link
Contributor

Hi @hostep, thanks for collaboration. After manual testing we found the next problem:

Problem: Cannot upload product image.
Manual testing scenario:

In the backend configuration go to: General > Web > Base URLs & Base URLs (Secure)
Enter {{unsecure_base_url}}media/ in "Base URL for User Media Files" and {{secure_base_url}}media/ in "Secure Base URL for User Media Files"
Save Config
Create simple product.
Go to Images And Videos section
Add image
Image isn't uploaded

@VladimirZaets
Copy link
Contributor

Hi @hostep, I am closing this PR now due to inactivity.
Please reopen and update if you wish to continue.
Thank you for collaboration

@hostep
Copy link
Contributor Author

hostep commented Nov 19, 2018

Hi @VladimirZaets

Sorry for the late feedback, I was away on holiday for 3 weeks.
Currently reopening to review your findings, probably later this week.

Even though I probably won't find a decent solution, so if some core dev from Magento with deep knowledge about this part of the code could weigh in some opinion, that would be very much appreciated!

Thanks!

@hostep hostep reopened this Nov 19, 2018
@hostep
Copy link
Contributor Author

hostep commented Nov 21, 2018

Hi @VladimirZaets

I can not reproduce the problem you are having, I'm also not really seeing the relevance of testing uploading an image while those settings are active in scope of this PR.
Anyway, here's my steps I took to try to reproduce your problem:

  • git checkout 49ad6d69925
  • composer install
  • bin/magento setup:install ... --cleanup-database
  • Open Magento backend
  • Create a new simple product and add an image => no problem
  • Go to Stores > Configuration > General > Web > Base Urls & Base Urls (Secure)
    • Set "Base URL for User Media Files" to {{unsecure_base_url}}media/
    • Set "Secure Base URL for User Media Files" to {{secure_base_url}}media/
    • Save Config
  • bin/magento cache:flush
  • Create a new simple product and add an image => no problem

Are you sure the issue you are experiencing is caused by this PR?

@hostep
Copy link
Contributor Author

hostep commented Feb 19, 2019

I just force pushed my branch with conflicts fixed which were caused by PR 19880

@VladimirZaets: any chance you can retest this?

@VasylShvorak
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Mar 30, 2019

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

None yet

7 participants