Automattic / liveblog

Liveblogging done right. Using WordPress.

Home Page:https://wordpress.org/plugins/liveblog/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Insert image not working

deepakrohillas opened this issue · comments

when we are trying to add image using "insert image" option in editor , it is completely hide Add new Entry panel with editor..
producing error in console
window.controllers/Controllers is deprecated. Do not use it for UA detection. 0.bundle.js:1:279357
The above error occurred in the component:
in Media (created by _class)
in div (created by _class)
in _class (created by DraftEditorContents)
in figure (created by DraftEditorContents)
in div (created by DraftEditorContents)
in DraftEditorContents (created by DraftEditor)
in div (created by DraftEditor)
in div (created by DraftEditor)
in div (created by DraftEditor)
in DraftEditor (created by EditorWrapper)
in div (created by EditorWrapper)
in div (created by EditorWrapper)
in EditorWrapper (created by EditorContainer)
in div (created by EditorContainer)
in EditorContainer (created by Connect(EditorContainer))
in Connect(EditorContainer) (created by AppContainer)
in div (created by AppContainer)
in AppContainer (created by Connect(AppContainer))
in Connect(AppContainer)
in Provider

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries. react-dom.development.js:9747
TypeError: image.media_details.sizes is undefined[Learn More]

solution 👍
only needs to add single line ie . if (!image || !image.media_details || !image.media_details.sizes) return '';
in getImageThumbnail function
var getImageThumbnail = function getImageThumbnail(image) {
if (!image || !image.media_details || !image.media_details.sizes) return '';
if (image.media_details.sizes.thumbnail) {
return image.media_details.sizes.thumbnail.source_url;
}
return '';
};