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

Comments

@gulshan-streammarket
Copy link

commented Oct 10, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2017

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

@gulshan-streammarket

This comment has been minimized.

Copy link
Author

commented Oct 10, 2017

Thank You. I will be waiting for fix.

@dmanners

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2017

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

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2017

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

@okorshenko

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

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 okorshenko closed this Oct 24, 2017

okorshenko pushed a commit that referenced this issue Oct 24, 2017
MAGETWO-82235: #11328 : app:config:dump adds extra space every time i…
…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 added a commit that referenced this issue Oct 24, 2017
okorshenko added a commit that referenced this issue Oct 24, 2017
Merge pull request #1607 from magento-engcom/develop-prs
#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
MAGETWO-82237: [Backport 2.1-develop] #11328 : app:config:dump adds e…
…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 added a commit that referenced this issue Oct 24, 2017
MAGETWO-82237: [Backport 2.1-develop] #11328 : app:config:dump adds e…
…xtra space every time in multiline array value #11451
okorshenko added a commit that referenced this issue Oct 24, 2017
Merge pull request #1609 from magento-engcom/2.1-develop-prs
#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

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

Internal ticket to track issue progress: MAGETWO-82237

okorshenko pushed a commit that referenced this issue Oct 24, 2017
MAGETWO-82236: [Backport 2.2-develop] #11328 : app:config:dump adds e…
…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 added a commit that referenced this issue Oct 24, 2017
MAGETWO-82236: [Backport 2.2-develop] #11328 : app:config:dump adds e…
…xtra space every time in multiline array value #11439
okorshenko added a commit that referenced this issue Oct 24, 2017
Merge pull request #1613 from magento-engcom/2.2-develop-prs
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 added a commit that referenced this issue Oct 24, 2017
MAGETWO-82236: [Backport 2.2-develop] #11328 : app:config:dump adds e…
…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 added a commit that referenced this issue Oct 24, 2017
MAGETWO-82236: [Backport 2.2-develop] #11328 : app:config:dump adds e…
…xtra space every time in multiline array value #11439
@magento-team

This comment has been minimized.

Copy link
Contributor

commented Oct 24, 2017

Internal ticket to track issue progress: MAGETWO-82236

okorshenko added a commit that referenced this issue Oct 25, 2017
MAGETWO-82235: #11328 : app:config:dump adds extra space every time i…
…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 added a commit that referenced this issue Oct 25, 2017
@magento-team

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2017

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
You can’t perform that action at this time.