I just got it working.
In image-widget.php line 44 replace
} elseif ( 'media-upload.php' == $pagenow || 'async-upload.php' == $pagenow ) {
add_filter( 'image_send_to_editor', array( $this,'image_send_to_editor'), 1, 8 );
add_filter( 'gettext', array( $this, 'replace_text_in_thitckbox' ), 1, 3 );
add_filter( 'media_upload_tabs', array( $this, 'media_upload_tabs' ) );
}
with
}
if ($this->is_sp_widget_context()) {
add_action( 'admin_init', array($this, "fix_async_upload_image") );
add_filter( 'image_send_to_editor', array( $this,'image_send_to_editor'), 1, 8 );
add_filter( 'gettext', array( $this, 'replace_text_in_thitckbox' ), 1, 3 );
add_filter( 'media_upload_tabs', array( $this, 'media_upload_tabs' ) );
}
Then add outside of all other functions:
function fix_async_upload_image() {
if(isset($_REQUEST['attachment_id'])) {
$GLOBALS['post'] = get_post($_REQUEST['attachment_id']);
}
}
It worked for me when I added it right after
function loadPluginTextDomain() {
load_plugin_textdomain( $this->pluginDomain, false, trailingslashit(basename(dirname(__FILE__))) . 'lang/');
}
Hope this helps.