0

In my custom module, I integrate Wysiwyg editor to admin form and it is working fine. but when I insert the external image path to the editor then it will show below error.

error: error in [unknown object].fireEvent(): event name: tinymceSetContent error message: Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.

But when I insert same image path to Product content then it will not be showing any error and be working fine. I don't understand what's going wrong.

Here is my code editor code.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $wysiwygConfig = $objectManager->create('Magento\Cms\Model\Wysiwyg\Config')->getConfig();
    $fieldset->addField(
        'about_uS',
        'editor',
        [
            'name' => 'about_uS',
            'label' => __('About US'),
            'title' => __('About US'),
            'wysiwyg' => true,
            'config' => $wysiwygConfig
        ]
    );

Edit:

When i place same image URL under Admin >> content >> pages also get same error.

Can anyone help me to solve out this problem?

Any help would be appreciated! Thanks.

0

I got solution after applying 'add_widgets' => false.

Hear is my code.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $wysiwygConfig = $objectManager->create('Magento\Cms\Model\Wysiwyg\Config')->getConfig(array('add_widgets' => false));
    $fieldset->addField(
        'about_uS',
        'editor',
        [
            'name' => 'about_uS',
            'label' => __('About US'),
            'title' => __('About US'),
            'wysiwyg' => true,
            'config' => $wysiwygConfig
        ]
    );

But i think this is not a proper way to solve problem, because i don't understand behind the reason of where 'add_widgets' => false affected.

If any have a better & proper way solution then post your answer for further user. it might be helpful to other user contributor.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.