XWiki Platform
  1. XWiki Platform
  2. XWIKI-13732

The create page form occasionally needs to be submitted twice

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      This is one is harder to reproduce.

      Basically, when submitting the create page form it will simply reload, without doing anything. Submitting the form a second time works and properly takes you to the new page in edit mode.

      It occurs more often on my machine, where my Firefox instance is overloaded and javascript execution is much slower to kick in.

      As far as I have been able to debug it at some point, I remember concluding that the XWiki Select widget fails to set in time the templateprovider parameter (from the document type you have selected) and, when you submit the first time, your request is sent without it. Thus, the CreateAction will not move forward, since it`s missing this mandatory field. Submitting the second time seems to give enough time to the Select Widget to do its job and build the correct request.

        Activity

        Hide
        Guillaume Delhumeau added a comment -

        It has nothing to do with the XWiki Select Widget but with the create.js file:
        https://github.com/xwiki/xwiki-platform/blob/0651eb472c0d1542d81931238ea6c126bfbb7afd/xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/create.js#L79-L79

        Indeed, if the JS is not executed yet, the input templateprovider will be missing.

        A fix could be to initialize a default value on the server side that JS can update, instead of letting JS create it.

        Show
        Guillaume Delhumeau added a comment - It has nothing to do with the XWiki Select Widget but with the create.js file: https://github.com/xwiki/xwiki-platform/blob/0651eb472c0d1542d81931238ea6c126bfbb7afd/xwiki-platform-core/xwiki-platform-web/src/main/webapp/resources/js/xwiki/create.js#L79-L79 Indeed, if the JS is not executed yet, the input templateprovider will be missing. A fix could be to initialize a default value on the server side that JS can update, instead of letting JS create it.

          People

          • Assignee:
            Guillaume Delhumeau
            Reporter:
            Eduard Moraru
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Date of First Response: