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

Fix select2 alert popup when window unloaded event occurs during the search automation call

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 6.0, 7.3
    • Fix Version/s: 6.0-HF17, 7.4
    • Component/s: Layouts & Widgets

      Description

      Steps to reproduce:

      We need to simulate a long automation call bound to a select2 widget (to simulate a load of document). To do so, let's set a breakpoint in org.nuxeo.ecm.platform.suggestbox.automation.SuggestOperation.run() and plug your debugger to a Nuxeo instance

      1- Login
      2- type whatever in the top right corner search field
      3- press enter while it is searching
      4- see the alert windows saying "Error while querying data from server: "

      The root cause is that clicking the Enter key while searching will trigger a navigation which fires a window unloaded event caught by jquery which will abort all pending ajax call.

      If ajax call has a failure callback, it will be called (typically the case for select2).

      Fix consists in displaying the alert window only if a sever internal error is detected (500).

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: