Score:0

Insert Media button in Ckeditor 5 not load with non admin user

ph flag

I use Drupal 9.5.5, CKeditor 5 and BootstrapBarrio theme, but I have also used Claro theme.

I have disabled "Aggregate JavaScript files" and "Aggregate CSS files" option in Performance, Insert Media with Media Library does not load when a user (non admin) edits node.

I get that errors:

Ocurrió un error durante la ejecución de la respuesta Ajax: TypeError: $element.dialog is not a function ajax.js:411:22
    success ...com/core/misc/ajax.js?v=9.5.5:411
    (Asíncrono: promise callback)
    success ...com/core/misc/ajax.js?v=9.5.5:410
    success ...com/core/misc/ajax.js?v=9.5.5:207
    jQuery 6
    execute ...com/core/misc/ajax.js?v=9.5.5:266
    openDialog ...com/core/modules/ckeditor5/js/ckeditor5.js?rrrmc2:280
    init ...com/core/modules/ckeditor5/js/build/drupalMedia.js?rrrmc2:1
    fire ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    click ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    s ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    fire ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5
    t ...com/core/assets/vendor/ckeditor5/ckeditor5-dll/ckeditor5-dll.js?v=35.4.0:5

Format filter and CKeditor 5 appear when I edit a node, but when I click "Insert media" button, media library does not load.

enter image description here

Any idea?

Thanks.

mx flag
Anonymous users shouldn't have the permission to post images and other media on the site because they can easily break the site or hack it by inserting code along with media. Maybe it's permissions that block showing the button in the editor.
RafaTicArte avatar
ph flag
Error appear in an authenticated user with right permissions, not with anonymous user. But admin user can open dialog to insert media without problem.
mx flag
Did you check permissions for authenticated users for text input formats?
RafaTicArte avatar
ph flag
Body field with CKeditor 5 and filter formar load right. "Insert media" button does not load media library. Permissions are right.
Score:1
cn flag

I had the same issue with the regular Media Library field. The latest patch here helped me solving that: https://www.drupal.org/project/drupal/issues/3222107 Looks like theres an issue with the set weight of the JS file which results in that error.

Hope, that helps! :)

RafaTicArte avatar
ph flag
Thanks!!!! Works for me! Media Library loads when I click in button from Ckeditor5.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.