• 
      

    Fix JS errors when closing the "Add File" dialog.

    Review Request #11254 — Created Oct. 29, 2020 and submitted

    Information

    Review Board
    release-4.0.x

    Reviewers

    DialogView subclasses (such as "Add File") could sometimes cause JS
    errors when they were closing. The issue here was a race between
    multiple event handlers. Inside the modalBox implementation (which is
    all our own jQuery-UI based code), a generic handler for clicks in the
    button area would cause the modal box to self-destruct. This could then
    conflict with the higher-level DialogView code which would additionally
    try to call destroy. In previous versions of jQuery-UI this didn't
    matter, but the version we're using now will error out when calling
    methods on elements which are not widgets.

    This change adds a check to make sure we don't try to destroy the
    modalBox widget after it's already self-destructed.

    • Manually tested the "Add File" dialog.
    • Ran js-tests without any modalBox-related errors.
    Summary ID
    Fix JS errors when closing the "Upload File" dialog.
    DialogView subclasses (such as "Upload File") could sometimes cause JS errors when they were closing. The issue here was a race between multiple event handlers. Inside the `modalBox` implementation (which is all our own jQuery-UI based code), a generic handler for clicks in the button area would cause the modal box to self-destruct. This could then conflict with the higher-level DialogView code which would additionally try to call destroy. In previous versions of jQuery-UI this didn't matter, but the version we're using now will error out when calling methods on elements which are not widgets. This change adds a check to make sure we don't try to destroy the modalBox widget after it's already self-destructed. Testing Done: Ran js-tests without any modalBox-related errors.
    f80cb200db76b6c0284bea5280a1789e2b00659c
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-4.0.x (f21586a)