silverstripe/silverstripe-framework — pull request #3081 by kinglozzer (2014-04-30 13:59:42+00:00)
Title: *Don’t merge* FIX: Ensure HtmlEditorField loads correct MediaForm/LinkForm (fixes #3034)

Proposed solution to #3034. Makes the `#cms-editor-dialogs` div a pjax fragment that’s updated each time a new LeftAndMain panel is loaded.

Changed the defaults for fragments set in `handleStateChange` as I wasn’t sure how best to approach hooking into that, or if it would even be appropriate to not make this new behaviour the default (do we ever *not* want to update the media/link form links?).

The other issue is that when clearing/changing the dialog’s inner HTML, an error occurs: Error: cannot call methods on selectable prior to initialization; attempted to call method 'destroy'. Triggered [here](https://github.com/silverstripe/silverstripe-framework/blob/3.1/javascript/GridField.js#L268). Tried all sorts of redraws, but couldn’t get my head around it so need a nudge from someone with greater knowledge than I :)