-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions
- 2.2.1
- PHP 7.x
Steps to reproduce
- Set the setting "cms/wysiwyg/use_static_urls_in_catalog"
- Add an image using the WYSIWYG editor in the admin panel
- Observe that the directive style URL is returned, not the static URL
Expected result
- The static URL (i.e. media URL without transformation) should be returned
Actual result
The directive URL is returned.
Magento uses specially formatted URLs of the form:
https://${ADMIN_DOMAIN}/cms/wysiwyg/directive/___directive/e3ttZWRpYSB1cmw9Ind5c2l3eWcvYmVkMi5wbmcifX0,/key/${ADMIN_KEY}/
To be able to render images in the wysiwyg editor. These URLs have two purposes:
- They are able to be processed by the stack, and show the appropriate image, and
- They contain the CMS directive for insertion into the stack in base64 in the ___directive component.
However, in some situations stores may wish to disable this behaviour such that the URL is instead the standard URL for that scope:
https://${ADMIN_DOMAIN}/media/wysiwyg/bed2.png
This is controlled with the setting in the issue title. However, it currently has no effect. I think it likely broke here:
The controller on the frontend posts an empty store which s picked up by:
and stored as ""
. The problem is, the store configuration is either looking for a numeric store code, or the type null
-- or it uses the configuration string exactly as supplied (i.e. ""
):
This malforms the path, queries the configuration tree but returns null
. It is thus impossible to use that setting from the frontend.
It's possible that this is a bug in third party code, not supplying the string default
in the post STORE. However, at this point I believe this to be a change in behaviour in upstream, and I will fix it accordingly.
Plan for this is just to check if store is "" in the OnInsert controller, and if it is, use null
and not "".