Index: src/wp-includes/js/mce-view.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/wp-includes/js/mce-view.js	(revision )
+++ src/wp-includes/js/mce-view.js	(revision 33406)
@@ -728,7 +728,8 @@
  * and a view for embeddable URLs.
  */
 ( function( window, views, $ ) {
-	var media, gallery, av, embed;
+	var postID = $( '#post_ID' ).val() || 0,
+		media, gallery, av, embed;
 
 	media = {
 		state: [],
@@ -759,7 +760,7 @@
 		template: wp.media.template( 'editor-gallery' ),
 
 		initialize: function() {
-			var attachments = wp.media.gallery.attachments( this.shortcode, wp.media.view.settings.post.id ),
+			var attachments = wp.media.gallery.attachments( this.shortcode, postID ),
 				attrs = this.shortcode.attrs.named,
 				self = this;
 
@@ -804,7 +805,7 @@
 			}
 
 			wp.ajax.post( this.action, {
-				post_ID: wp.media.view.settings.post.id,
+				post_ID: postID,
 				type: this.shortcode.tag,
 				shortcode: this.shortcode.string()
 			} )
