Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"widget toolbar no items" {toolbarId: 'mediaEmbed'} #267

Closed
albertovalerio opened this issue Oct 26, 2021 · 4 comments
Closed

"widget toolbar no items" {toolbarId: 'mediaEmbed'} #267

albertovalerio opened this issue Oct 26, 2021 · 4 comments

Comments

@albertovalerio
Copy link

I got this warning in console when component is rendered

Screenshot 2021-10-25 at 19 00 13

This is the error reference on official doc

https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-widget-toolbar-no-items

And this is my component

export const EditorField = (props) => {

    const {name,method,placeholder,isSimplified} = props

    const link = {
        decorators: {
            toggleDownloadable: {
                mode: 'manual',
                label: 'Downloadable',
                attributes: {
                    download: 'file'
                }
            },
            openInNewTab: {
                mode: 'manual',
                label: 'Open in a new tab',
                defaultValue: true,
                attributes: {
                    target: '_blank',
                    rel: 'noopener noreferrer'
                }
            }
        }
    }
    const image = {
        toolbar: [
            'imageTextAlternative',
            'imageStyle:inline',
            'imageStyle:block',
            'imageStyle:side',
            'linkImage'
        ]
    }
    const table = {
        contentToolbar: [
            'tableColumn',
            'tableRow',
            'mergeTableCells',
            'tableCellProperties',
            'tableProperties'
        ]
    }
    const toolbar = isSimplified ? {
        items: [
            'bold','italic','underline','strikethrough','|',
            'link','|',
            'specialCharacters','|',
            'undo','redo'
        ], shouldNotGroupWhenFull: true
    } : {
        items: [
            'heading','|',
            'bold','italic','underline','strikethrough','|',
            'fontColor','fontBackgroundColor','|',
            'bulletedList','numberedList','|',
            'link','imageUpload','insertTable','mediaEmbed','|',
            'specialCharacters','blockQuote','horizontalLine','|',
            'undo','redo'
        ], shouldNotGroupWhenFull: true
    }

    return (
        <CKEditor
            config={ {
                toolbar,
                language: 'it',
                placeholder,
                link,
                image,
                table,
            } }
            editor={ Editor }
            data={request[name] || ''}
            onChange={ (event, editor) => {
                const data = editor.getData()
                dispatch(setValue({method,name,value:data}))
            } }
        />
    )
}
@albertovalerio
Copy link
Author

It was suggested to me this solution on Stackoverflow, it works and does not affect the editor's functionalities.

Add this to your config:
removePlugins: ["MediaEmbedToolbar"],
At the moment, this plugin doesn't do anything:
ckeditor/ckeditor5#9824

@smileBeda
Copy link

smileBeda commented Apr 24, 2022

This is weird.
That thing is included by default in the creditor builds.

This shouldn't be closed, I think, since it still happens.
Also the DOC link they provide in the debug note points to https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-widget-toolbar-no-items
This doc says, that the error refers to whatever tool with ID as in toolbarId : String
The ID there is mediaEmbed
And that is not a "does nothing" tool, it is well documented here actually https://ckeditor.com/docs/ckeditor5/latest/features/media-embed.html

And that is used to embed videos.
Nonetheless if we remove MediaEmbedToolbar plugin the error disappears, and the embed tool still works

Being this the default behaviour, I would expect it to be fixed. Here it was stated that "it does nothing", but that does not seem true to me:
ckeditor/ckeditor5#9824

@benzon
Copy link

benzon commented Dec 20, 2022

dos not look like it will be fixed, it's what more then half a year since you reopened it, and more then a year ago the bug was reported.

Facing the same issue currently so something is wrong i guess.

@Mohsen-graphyy
Copy link

Hi, I fixed this problem by adding this config :
{ removePlugins: ['MediaEmbedToolbar'] }
It works for me and I no longer get this warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants