Silverstripe-framework: JS Confirm dialog when creating versioned DataObject

Created on 9 Nov 2017  路  4Comments  路  Source: silverstripe/silverstripe-framework

As briefly discussed on Slack SS4 channel, I'm getting an issue when trying to create new versioned DataObjects, a browser confirmation prompt appears when clicking the create button asking if _I'm sure I want to navigate away from the page_ AFTER an AJAX call has already fired to create the object.

I've created a small repo where you can reproduce the issue, simple clone it, composer install and /dev/build then follow my steps below.


  1. Navigate to Example model admin interface

screen shot 2017-11-09 at 15 39 34



  1. Click Add New MyObj

screen shot 2017-11-09 at 15 39 46



  1. Put some information in

screen shot 2017-11-09 at 15 40 09



  1. Click Create (pop up appears

screen shot 2017-11-09 at 15 40 21



  1. Click Cancel (notice that the URL updated to reflect new object ID)

screen shot 2017-11-09 at 15 40 34



  1. Click Create again (pop up appears again, create button has Create text and loading animation overlapping)

screen shot 2017-11-09 at 15 41 10



  1. Click okay in the pop up (notice URL updated again, now with newest object ID)

screen shot 2017-11-09 at 15 41 30



  1. Navigate back to see 2 instances of the object in the GridField

screen shot 2017-11-09 at 15 41 49

affectv4 changpatch efformedium impaccritical typbug

All 4 comments

I've seen the same behaviour on a non-versioned DataObject attached to a page (edited via Gridfield).

Getting the same issue here too

Thank you for the awesome issue description! 猸愶笍 猸愶笍 猸愶笍
I've added this as an impact/high issue into the 4.0.1 milestone.

Was this page helpful?
0 / 5 - 0 ratings