Uploaded image for project: 'Magnolia Personalization'
  1. Magnolia Personalization
  2. MGNLPN-221

SegmentationMultiField: segment relation validation based on path comparison causes false-positives

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 1.1.3
    • None
    • None
    • Sprint 2 (Basel)
    • 1

      When validating the segments Magnolia seems to check if any two of selected segments share the same starting path
      In SegmentationMultiField

                  Node node2 = session.getNodeByIdentifier(uuid2);
                  if (node1.getPath().equals(node2.getPath())) {
                      return false;
                  }
                  if (StringUtils.startsWith(node1.getPath(), node2.getPath())) {
                      return false;
                  }
                  if (StringUtils.startsWith(node2.getPath(), node1.getPath())) {
                      return false;
                  }
              }
      

      I two last checks if the first segment is parent of the second one fail when the name of the first segment start with the name of the second segment (and vice versa):

      • StringUtils.startsWith(node1.getPath(), node2.getPath())
      • StringUtils.startsWith(node2.getPath(), node1.getPath())

      Otherwise if one defines and select segments like:

      • FOO
      • FOO+BAR
        It will result in a validation error

        Acceptance criteria

              ajuran AntonĂ­n Juran
              rmikoda Robert Mikoda
              Benoit Olbrechts, David Wartel, Gregory Vandenbroucke, Hugo Venancio, Robert Mikoda
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD