This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

Cpt.Meatball
Cpt.Meatball

I've used MediaManager together with CKEditor to provide embed functionality for my clients. It worked great, until 5 minutes ago when I updated the core.

Upon opening MediaManager within CKeditor I get following error message:

A Widget with classname 'mediamanager' has not been bound to the controller on line 512 ***/***/***/modules/backend/classes/Controller.php

I'm calling mediamanager like this in a CKEditor plugin:

new $.oc.mediaManager.popup({
                    alias: 'mediamanager',
                    cropAndInsertButton: true,
                    onInsert: function(items) {
                        if (!items.length) 
                        {
                            alert('Please select image(s) to insert.')
                            return;
                        }

                        for (var i=0, len=items.length; i<len; i++) {
                            if (items[i].documentType !== 'image') {
                                alert('The file "'+items[i].title+'" is not an image.')
                                continue
                            }

                            editor.insertHtml('<img src="' + items[i].publicUrl + '" />', 'unfiltered_html');
                        }

                        this.hide();
                    }
                });

This worked before updating to build 290. It's been some time since i last updated, so I didn't come from the previous build.

EDIT:

Fixed it by binding the MediaManager in the Controller it is used:

use Cms\Widgets\MediaManager;
...
$mediamanager = new MediaManager($this, 'mediamanager');
$mediamanager->bindToController();

Last updated

salma el hajraoui
salma el hajraoui

thank you @Cpt.Meatball

MDSAI.COM
MDSAI.COM

Hi, I'm trying to do the same from the frontend component and can't find any examples. The closest thing to what I want to do is this post. Could you put more code to understand it better? Thanks

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.