Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27626

validate function is called twice in create-layout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 11.1, 2021.0
    • Component/s: DAM, Web UI
    • Backlog priority:
      700
    • Sprint:
      nxGang Sprint 11.1.12
    • Story Points:
      1

      Description

      Steps to reproduce:

      • Have a server running (Nuxeo OOTB is fine)
      • Connect to it; navigate to a container where you can create a File (Workspace or Folder, typically)
      • Open nxserver/nuxeo.war/ui/document/nuxeo-file-create-layout.html
      • In the script, add this validate function, after the properties object:
          . . .
            properties: {
              document: Object
            },
            validate: function() {
              console.log("Validate");
              return true;
            }
          . . .
      • Shift-Reload the page
      • Display the creation dialog
      • Show the WebInspector, in the Console tab
      • Create a new File document, setup the title, click the "Create" button
      • See "validate" is displayed twice.

      Environment  is Nuxeo 10.10 with HF04

       

      Workaround involves a flag, it's not elegant , and more importantly, maybe it reveals some performance/logic issues:

            properties: {
              document: Object,
              validateDoneOnce: {
                type: Boolean,
                value: false
              }
            },
            validate: function() {
              if(!this.validateDoneOnce) {
                console.log("Validate");
                this.validateDoneOnce = true;
              }
              return true;
            }
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 20 minutes
                1d 20m