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

Web content field value is overwritten by current value and it can accidentally create a new translation every time we visit a locale

Details

    Description

      Reproduction:

      1. Go to Web Content -> Create basic web content
      2. type "1" into all fields (current locale "en-US")
      3. change the locale to "ca-ES"
      4. Don't change any of the fields
      5. Change to a new locale again "zh-CN"
      6. type "2" into all fields
      7. Change to a new locale again "nl-NL"

      Expected behaviour : The placeholder values are the same as the default Languge's value ( "en-US", value should be "1")
      Actual: The placeholder values are the same as the last modified locale "zh-CN". value is "2"

      1. Don't change any of the fields
      2. Change to a new locale
      3. Don't change any of the fields
      4. Go back to the default locale and hit publish
      5. cick on the kebab menu of the created web content -> Delete Translations

      Expected: We only created the default (English) and "zh-CH" translations.
      Actual: We created a translation every when we visited a locale and the placeholder value was not the default value

      Root Cause:
      LPS-105572
      https://github.com/brianchandotcom/liferay-portal/pull/82062/commits/e487d3c1c972008c1207071a8470884053ea060d

      We should not use the current value in the editor for the next localisation instead of the default locale's value, as our business logic in saving the translations are depending on the difference between the default's locale value and the current one.
      in ddm_form.js updateeLocalizationMap()

      if (locale === defaultLocale ||
      	value !== localizationMap[defaultLocale] ||
      	LocalizationMap[locale] ) {
      		localizationMap[locale] = value;
      }
      

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          35 kB
        2. screenshot-2.png
          screenshot-2.png
          31 kB
        3. screenshot-3.png
          screenshot-3.png
          21 kB

        Issue Links

          Activity

            People

              harry.chai Harry Chai
              norbert.nemeth Norbert Németh
              Marta Elicegui Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                2 years, 18 weeks, 4 days ago

                Packages

                  Version Package
                  7.1.10 DXP FP18
                  7.1.10.5 SP5
                  7.1.X
                  7.2.10 DXP FP6
                  7.2.X
                  7.3.3 CE GA4
                  7.3.10 DXP GA1
                  Master