Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-1477

nuxeo-group-tag error with null value

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.0.10
    • Fix Version/s: None
    • Component/s: UI

      Description

      The <nuxeo-group-tag> doesn't like a null value.

      Layout:

      <nuxeo-group-tag group="[[document.properties.my:group]]"></nuxeo-group-tag>
      

      If the my:group property is null, the following error is output to the browser console:

      main.bundle.js:12648 Uncaught TypeError: Cannot read properties of null (reading 'label')
          at e._label (954.bundle.js:4029:482)
          at V (main.bundle.js:12648:74402)
          at Function._evaluateBinding (main.bundle.js:12648:88771)
          at Object.Y [as fn] (main.bundle.js:12648:72641)
          at M (main.bundle.js:12648:69847)
          at r (main.bundle.js:12648:81749)
          at l._runEffectsForTemplate (main.bundle.js:12648:81904)
          at l._propagatePropertyChanges (main.bundle.js:12648:81651)
          at l._propertiesChanged (main.bundle.js:12648:81181)
          at l._flushProperties (main.bundle.js:12648:62594)
      

      Workaround: Define a helper function that returns an empty string if null e.g.

      <nuxeo-group-tag group="[[_getGroup(document, 'my:group')]]"></nuxeo-group-tag>
      ...
      _getGroup(doc, xpath) {
        return doc &&
               doc.properties &&
               doc.properties[xpath] || "";
      },

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              msaye Mark Saye
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: