-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Event: balance-cdEvent: distributed-cdDistributed Contribution DayDistributed Contribution DayEvent: kiev-cdFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release
Description
As of 2.2.3, it's not possible to upload images via the WYSIWYG if the media directory is a symlink. This is due to this new file.
Preconditions
- Install Magento 2.2.3
- Ensure that the media directory is a symlink. For example, the
pub/media
directory should be a symlink that points somewhere else.
Steps to reproduce
- Edit a CMS Block and click "Insert Image".
- Try to upload an image.
Expected result
- The image should upload successfully.
Actual result
- You'll get an error like this:
Directory /var/www/prod/releases/20180228212716/pub/media/wysiwyg is not under storage root path.
Workaround
UPDATE: As of Magento 2.2.5 / 2.3.0, this issue has been fixed and you shouldn't apply the patch below or else you'll break the functionality.
We've temporarily fixed this by changing this line from this:
$realPath = realpath($path);
$root = $this->directoryList->getPath($directoryConfig);
to this (note the addition of the realpath
function call):
$realPath = realpath($path);
// BEGIN EDIT
/**
* Since media directory is a symlink, need to run both paths through realpath in order for the comparison to
* work.
* The proper fix for this should involve a STORE > Configuration setting where an admin can choose whether to
* allow symlinked directories.
*/
$root = realpath($this->directoryList->getPath($directoryConfig));
// END EDIT
hostep, minhluan259, erikhansen, hanhpv, JosephMaxwell and 20 more
Metadata
Metadata
Assignees
Labels
Event: balance-cdEvent: distributed-cdDistributed Contribution DayDistributed Contribution DayEvent: kiev-cdFixed in 2.3.xThe issue has been fixed in 2.3 release lineThe issue has been fixed in 2.3 release lineIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.1.xThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.1 releaseReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseThe issue has been reproduced on latest 2.3 release