Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-139617

Updates sent back to .config file include whitepaces around equal sign

    Details

      Description

      With the inclusion of LPS-136376, we now use typed configuration values for .config file types.  This means when we save the configuration, export it, or update the .config file after an update in the UI, the configuration values are typed. 

      However, we also have a minor issue where changes pushed back into the existing .config file include spaces around the equals sign.  For configurations saved to the DB or exported, there are no whitespaces:
      configurationBoolean = B"true"
      vs
      configurationBoolean=B"true"

      This causes no functional issues, however there is a lack of consistency and may ionterfere with version control software (files maybe overwritten to include whitespace).

      We added this whitespace with the inclusion of LPS-118855, seemingly for readability purposes.

      Steps to reproduce:

      1. Sign in as [email protected]
      2. Go to Control Panel > System Settings > Web Content
      3. Click on the Administration on the left hand menu under System Scope
      4. Click the checkbox next to "Journal Article Show ID" to enable the setting
      5. Save
      6. Export the file and save it as com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config
      7. Examine the file and observe its contents as follows:

      • autogenerateDDMStructureKey=B"true"
        autogenerateDDMTemplateKey=B"true"
        changeableDefaultLanguage=B"false"
        defaultDisplayView="descriptive"
        displayViews=[ \
          "icon", \
          "descriptive", \
          "list", \
          ]
        journalArticleForceAutogenerateId=B"true"
        journalArticleShowId=B"true"
        journalBrowseByStructuresSortedByName=B"true"
        journalDDMTemplateLanguageTypes=[ \
          "ftl", \
          ]
        journalFeedForceAutogenerateId=B"true"
        maxAddMenuItems=I"7"
        showAncestorScopesByDefault=B"false"
        showFeeds=B"false"
        structureFieldIndexableEnable=B"true"

      8. Copy com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config to $liferay.home/osgi/configs
      9. Restart the server
      10. Go back to Control Panel > System Settings > Web Content
      11. Click on the Administration on the left hand menu under System Scope
      12. Scroll down and click "Update"
      13. In the file system, examine com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config in $liferay.home/osgi/configs
      14. Assert that you observe the contents as follows:

      • autogenerateDDMStructureKey = B"true"
        autogenerateDDMTemplateKey = B"true"
        changeableDefaultLanguage = B"false"
        defaultDisplayView="descriptive"
        displayViews=[ \
          "icon", \
          "descriptive", \
          "list", \
          ]
        journalArticleForceAutogenerateId = B"true"
        journalArticleShowId = B"true"
        journalBrowseByStructuresSortedByName = B"true"
        journalDDMTemplateLanguageTypes=[ \
          "ftl", \
          ]
        journalFeedForceAutogenerateId = B"true"
        maxAddMenuItems = I"7"
        showAncestorScopesByDefault = B"false"
        showFeeds = B"false"
        structureFieldIndexableEnable = B"true"

      Actual Behavior
      The com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config file when saved through the UI has spaces before and after the equal sign, where as the exported com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config has no whitespace.  This is also true for the entry saved to the configuration_ table.

      Expected Behavior
      Both the com.liferay.journal.web.internal.configuration.JournalWebConfiguration.config saved in the UI or exported will not contain whitepace.

      Reproduced in

      • 7.3.X-private Commit: 6db37520573b824f3ae2d6e44455f2634009740a
      • Master-private Commit: aa58c3de6565738bae5237e3622436ba25230a18

        Attachments

          Activity

            People

            Assignee:
            jayda.wu Jayda Wu
            Reporter:
            christopher.kian Christopher Kian
            Participants of an Issue:
            Recent user:
            Sophia Zhang
            Engineering Assignee:
            Christopher Kian
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              7 weeks, 2 days ago

                Packages

                Version Package
                7.3.X
                7.4.13 DXP GA1
                7.4.3.4 CE GA4
                Master