We have Use Static URLs for Media Content in WYSIWYG set to No. And if we insert images with the "Insert Images..." button when the wysiwyg editor is hidden, it works. It inserts something like:

<img src="{{media url="wysiwyg/image.jpg"}}" alt="" />

It gets the correct data to insert using the link:


Sending filename, node, store, as_is = 1, force_static_path = 0 and form_key. Some of this data is base64encoded

With the wysiwyg editor the element inserted is something like:

<img src="wysiwyg/image.jpg" alt="">

I see it tries to access 2 urls.


Getting the error:

1 exception(s):
Exception #0 (Exception): Warning: DOMDocument::loadXML(): Empty string supplied as input in /vendor/magento/framework/View/Element/UiComponent/Config/DomMerger.php on line 327

And the url:


getting the error:

Requested path 'wysiwyg/image.jpg' is wrong.
<pre>#1 Magento\Framework\App\StaticResource->launch() called at [vendor/magento/framework/App/Bootstrap.php:263]
#2 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\StaticResource#000000007ce5886c0000000018f98acf#) called at [pub/static.php:13]


I installed a test version of 2.4.4, with TinyMCE 5, and after selecting the image to add. In the Insert/Edit Image dialog, the Source valur is different from the previous results:


It gets the result after accessing:


So maybe the problem is the url used in TinyMCE4 in my Magento 2.4.1.

1 Answer 1


It is possible that the database value base_media_url is empty. Check it with the following queries:

SELECT value FROM core_config_data WHERE path='web/secure/base_media_url';
SELECT value FROM core_config_data WHERE path='web/unsecure/base_media_url';

You can update both values with the queries:

UPDATE core_config_data SET value = '/path/to/media' WHERE path LIKE 'web/secure/base_media_url';
UPDATE core_config_data SET value = '/path/to/media' WHERE path LIKE 'web/unsecure/base_media_url';
  • @sadlyblue I believe that Magento 2 URLs should be the full URL to the media directory, just like in Magento 1. I think that you can use placeholders such as {{unsecure_base_url}} as well. But double-check that, as I'm also just stepping into Magento 2 and it is full of surprises. Let me know ))
    – dotancohen
    Commented Aug 3, 2022 at 15:41
  • Yes they are null. I tried several values, clearing cache everytime. Only {{secure_base_url}}pub/media/ showed the images in the select image dialog. But it still adds the same code to the description, with the same errors when i click Ok to add the image.
    – sadlyblue
    Commented Aug 3, 2022 at 15:44
  • 1
    I just checked on a default install, and the values are NULL here as well. But adding images works fine (v 2.4.4).
    – dotancohen
    Commented Aug 3, 2022 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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