Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-7835

EditContentFunction : Unable to set a repeater larger than 9 elements when content.metadata.set is not set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 4.0RC5
    • 3.9, 4.0M12
    • Workflow
    • None

      When the content.metadata.set parameter is not set, the metadata set to edit is build from the field names founded into values parameter.

      For repeater elements, the name is truncated without the prefix and index informations.
      For example, a metadata named content.input.myrepeater.1.label become myrepeater.label.

      To do this, we test all field names with the prefix content.input.myrepeater.1 to identify which ones will be treated.

      But, if you have a repeater larger than 9 elements, you should also have the following field name content.input.myrepeater.10.label. It will be treated as the first element and will became myrepeater0.label.

      Then edition fails.

      To resolve this issue, you can change the numPrefix variable into getMetadataSet() method (3.9) or _createMetadataSet() method (4.0) like this :

      String numPrefix = "." + i + ".";

      Then change the newName variable like this :

      String newName = parameterNames2MetadataDefPath.substring(0, prefix.length() - numPrefix.length()) + parameterNames2MetadataDefPath.substring(prefix.length() - 1);

      It should be enough to solve it.

            raphael Raphaël Franchet
            bmaurel Bérénice Maurel
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: