Skip to content

Static CMS image urls when using a different (sub)domain for custom admin url #32930

Closed
@elouwerse

Description

@elouwerse

Preconditions (*)

  1. Magento 2.4.2

Steps to reproduce (*)

  1. Admin panel » Stores » Configuration » General » Content Management » Use Static URLs for Media Content in WYSIWYG: No
  2. Admin panel » Stores » Configuration » Advanced » Admin » Admin Base URL » Use Custom Admin URL: Yes
  3. Set admin to a different (sub)domain than the actual store url.
  4. Add/edit a CMS page, static block or product page
  5. Add image

Expected result (*)

  1. Media tag with relative image url
  2. <img src="{{media url="wysiwyg/test-image.png"}}" alt="">

Actual result (*)

  1. Media tag with static Magento admin url instead of store url
  2. <img src="{{media url="https://dev.magentotest.local/wysiwyg/test-image.png"}}" alt="">

This issue is caused by inconsistend use of $this->_storeManager->getStore() in /vendor/magento/module-cms/Helper/Wysiwyg/Images.php
Line 214: $this->_storeManager->getStore()
Line 299: $this->_storeManager->getStore($this->_storeId)


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Component: Framework/WysiwygFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: ready for confirmationPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: doneReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions