Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-7633

Backport (7.8) - Documents and folders get locale-specific names by default

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.22.17, 2.24.04, 2.26.00-alpha-1
    • 2.24.07.1, 2.24.09
    • None
    • None

    Description

      New documents and folders with a name other than the JCR node name get a locale-specific 'pretty name'. As a result, logging in with another language shows the JCR node name instead of the entered pretty.

      Steps to reproduce in the archetype:
      1. Login with language English
      2. Navigate to the 'Browse' perspective
      3. Add a new folder with the name 'My Folder'
      4. Logout
      5. Login with language Dutch
      6. Navigate to the Browse perspective and locate the folder

      Expected: the folder is called 'My Folder'
      Actual: the folder is called 'my-folder'

      The same happens for documents, images and assets.

      More info: when the 'pretty' name of the folder is different from the JCR node name (due to the spaces and capitals), the 'my-folder' node will get a child node 'hippo:translation' with a property 'hippo:message' set to 'My Folder' and a property 'hippo:language'. The property 'hippo:language' should be set to an empty string, which was the behavior <= 7.8.3 and <= 7.7.9. As a result, any folder created in the CMS could have only one pretty name. Currently, the property 'hippo:language' is set the the locale of the CMS (e.g. the one selected in the login screen). This is the behavior in >= 7.8.4 and >= 7.7.10. As a result, all folders and documents created via the CMS get a completely different name depending on the CMS language.

      The following XPATH query reveals all hippo:translation nodes with a non-empty hippo:language property:

      /jcr:root/content/documents//*@hippo:language

      Many parts of the CMS could not cope with such specific locales for folders. One example is fixed in CMS7-7092, but the fix in there was all wrong. In fact, the 'bug' described in CMS7-7092 is in fact the correct behavior! The folder in the related customer issue most likely had a specific locale 'nl', and a user logged in with language 'Dutch' tried to rename it. In that case a second hippo:translation node would be added with an empty locale and the new name. Yet the CMS would still show the value of the first hippo:translation node because it had a specific 'nl' locale for the current CMS language. Consequently, the user thought his rename failed. So the root problem is that the folder had a specific locale in the first place.

      Due to changes in CMS7-7096 and CMS7-7441, all new folders and documents created in the CMS whose pretty names differ from the JCR node name, will now have a pretty name specific for the CMS locale of the user who created it. All projects that run CMS >= 7.8.4 or CMS >= 7.7.10 may contain such 'polluted' folders and documents in their repositories.

      Proposed fix:

      1. We revert the old behavior when creating new documents and folders. They will again get a hippo:translation node with the 'hippo:message' property set to the display name, and an EMPTY hippo:language property. New documents and folders will thus have ONLY ONE display name.

      2. If a document or folder with multiple translations is renamed, the new name replaces all existing translations. The rename dialog will initially show a warning to make this explicit. Hence, multiple translations are also converted to case 1 after a rename.

      3. If a document or folder has only one translation with an explicit locale, the new name will replace the existing one without a warning, and the hippo:language property will be made empty again. This 'fixes' the erroneous situation introduced by earlier changes.

      Attachments

        Issue Links

          Activity

            People

              jsheriff Junaidh Kadhar Sheriff
              mdenburger Mathijs den Burger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: