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

app:config:dump adds extra space every time in multiline array value #11328

Closed
gulshan-streammarket opened this issue Oct 10, 2017 · 8 comments
Closed
Assignees
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release

Comments

@gulshan-streammarket
Copy link

Preconditions

  1. php 7.0.19
  2. Magento 2.2

Steps to reproduce

  1. RUN > php bin/magento app:config:dump
  2. Search for 'address_templates' key in config.php and count number of spacees in every line of formatted multiline text value.
  3. Now run again>php bin/magento app:config:dump
  4. Again check for number of spaces. You will find two more space.
  5. Every time when we dump of execute setup:upgrade it adds extra space to multiline config value.

Expected result

  1. There should be no extra space if there is no change in the configuration.

Actual result

  1. It adds extra space and it shows as modified in git local working copy. So every time it needs commit when sending feature to repository.
    m2-config-issue
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Oct 10, 2017
@orlangur orlangur added the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Oct 10, 2017
@magento-engcom-team
Copy link
Contributor

@gulshan-streammarket, thank you for your report.
We've created internal ticket(s) MAGETWO-81401 to track progress on the issue.

@magento-engcom-team magento-engcom-team added 2.2.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 10, 2017
@gulshan-streammarket
Copy link
Author

Thank You. I will be waiting for fix.

@dmanners
Copy link
Contributor

For more detail on the problem the issue is with config elements that contain \n in them. For example the address templates or the search_engine_robots->default_custom_instructions section.

The problem happens in the class lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php https://github.com/magento/magento2/blob/2.2-develop/lib/internal/Magento/Framework/App/DeploymentConfig/Writer/PhpFormatter.php#L37 when formatting the output it replaces \n characters with \n

return "<?php\nreturn array (\n" . implode(",\n", str_replace("\n", "\n ", $elements)) . "\n);\n"; I think that a good solution here would be to change the way that this file is created

@adrian-martinez-interactiv4
Copy link
Contributor

@gulshan-streammarket @dmanners Hope this PR fixes this issue

@okorshenko
Copy link
Contributor

Hi @gulshan-streammarket the issue has been fixed in 2.1-develop branch. PRs to 2.2 and 2.3 are on the way. Closing the issue

okorshenko pushed a commit that referenced this issue Oct 24, 2017
…n multiline array value #11452

 - Merge Pull Request #11452 from adrian-martinez-interactiv4/magento2:FR#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. c23f4dc
   2. a79c704
   3. dd7dba1
okorshenko pushed a commit that referenced this issue Oct 24, 2017
okorshenko pushed a commit that referenced this issue Oct 24, 2017
#11546 Add AuthenticationInterface to the public API by @navarr
#11659 [TASK] Removed Typo in Paypal TestCase didgit => digit by @lewisvoncken
#11649 #7915: customer objects are equal to eachother after observing event customer_save_after_data_object by @RomaKis
#11587 #11586 Fix duplicated crontab 2>&1 expression by @adrian-martinez-interactiv4
#11609 Fix a typo by @ajpevers
#11582 M2 11581 by @tzyganu
#11452 #11328 : app:config:dump adds extra space every time in multiline array value by @adrian-martinez-interactiv4
#11457 Added carrier code to ID to distinguish shipping methods [port 2.3] by @peterjaap
#10769 Fix: Keep packages sorted by @localheinz
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11451

 - Merge Pull Request #11451 from adrian-martinez-interactiv4/magento2:FR21#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. 018c111
   2. 1a1637a
   3. 081f4c6
   4. c4fb81f
   5. 1a28e45
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11451
okorshenko pushed a commit that referenced this issue Oct 24, 2017
#11378 Save region correctly to save sales address from admin [backport] by @raumatbel
#11451 [Backport 2.1-develop] #11328 : app:config:dump adds extra space every time in multiline array value by @adrian-martinez-interactiv4
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82237

okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11439

 - Merge Pull Request #11439 from adrian-martinez-interactiv4/magento2:FR22#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. 00f243c
   2. 6f9497a
   3. 55d4a83
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11439
okorshenko pushed a commit that referenced this issue Oct 24, 2017
Public Pull Requests

#11591 [Backport 2.2-develop] #11586 Fix duplicated crontab 2>&1 expression by @adrian-martinez-interactiv4
#11561 Magento sets ISO invalid language code by @crissanclick
#11553 [2.2 Backport] ProductRepository sku cache is corrupted when cacheLimit is reached by @heldchen
#11439 [Backport 2.2-develop] #11328 : app:config:dump adds extra space every time in multiline array value by @adrian-martinez-interactiv4
#11510 Add interaction to admin:user:create command by @cmuench
#11522 [Backport 2.2-develop] Fix Filter Customer Report Review by @osrecio
#11499 Ensure database is cleared/Magento reinstalled when TESTS_CLEANUP is enabled by @joshuaswarren
#11385 Fix #10856: Sync billing with shipping address on Admin Order Page by @joni-jones
#11317 [Backport 2.2-develop] Send email to subscribers only when are new by @osrecio
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11439

 - Merge Pull Request #11439 from adrian-martinez-interactiv4/magento2:FR22#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. 00f243c
   2. 6f9497a
   3. 55d4a83
   4. 163ae73
okorshenko pushed a commit that referenced this issue Oct 24, 2017
…xtra space every time in multiline array value #11439
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82236

okorshenko pushed a commit that referenced this issue Oct 25, 2017
…n multiline array value #11452

 - Merge Pull Request #11452 from adrian-martinez-interactiv4/magento2:FR#11328-APP-CONFIG-DUMP-EXTRA-SPACES
 - Merged commits:
   1. c23f4dc
   2. a79c704
   3. dd7dba1
   4. 1740f62
okorshenko pushed a commit that referenced this issue Oct 25, 2017
@magento-team
Copy link
Contributor

Internal ticket to track issue progress: MAGETWO-82235

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

No branches or pull requests

8 participants