Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    problem with DynamicForm.checkFileAccessOnSubmit resulting in empty submission

    Hi,

    Tested with 12.1 - 2025-03-23, but I see that it is the same in code at least up to 13.1.

    Minor problem is doc saying that checkFileAccessOnSubmit concerns only DynamicForms with FileItems, while it also important for forms with UploadItems.

    Problem appeared when upgrading following DynamicForm submit code from 12.0 to 12.1 where checkFileAccessOnSubmit was introduced.
    Code:
    submit: function() {
        if(this.validate()) {
          this.submitForm();
          this.disable();
        }
    As checkFileAccessOnSubmit is true by default, submitForm calls native form.submit() asynchronously after performing checks in form._verifyFileAccessAndSubmit -> uploadItem.checkFileAccess -> uploadItem.checkFileScript
    When (native) form.submit() is called, the form and all inputs are already disabled by this.disable() in a code above and no data is effectively submitted to server.

    To workaround I suggest adding flag that would save current disabled state in DynamicForm.submitForm just before call to _verifyFileAccessAndSubmit.
    Then using this flag in submitNativeForm to restore enabled state just before call to native form.submit() (and then restoring it back after form.submit())

    Best regards,
    Janusz
Working...
X