Skip to content

Conversation

@Tomasz-Silpion
Copy link
Member

Description

Due to Magento 2 architecture and hardcoded url paths in \Magento\Framework\App\Filesystem\DirectoryList command line interface returns wrong path to media files when document root is mounted in pub folder.

Fixed Issues (if relevant)

  1. [2.x.x] Production mode is not detected in CLI => the uri for media and static are not good and contain pub #8868: [2.x.x] Production mode is not detected in CLI => the uri for media and static are not good and contain pub
  2. Cron gets wrong base media URL #9111: Cron gets wrong base media URL

Manual testing scenarios

  1. Set server document root to pub directory
  2. Run console command that returns base media url.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Sep 21, 2018

Hi @Tomasz-Silpion @engcom-backlog-nazar ,
Looks like this issue was fixed in 2.2-develop and was included into Magento 2.2.6 release: 4a0dc86
Also the same fix was done in 2.3-develop: 3a1eab9
Could you check it?

@ihor-sviziev ihor-sviziev self-assigned this Sep 21, 2018
@ghost
Copy link

ghost commented Sep 21, 2018

Hi @ihor-sviziev Seems like this not fixed in 2.3-develop
selection_119

@ihor-sviziev
Copy link
Contributor

Hi @Tomasz-Silpion ,
I discussed with @engcom-backlog-nazar in Slack and we found that this issue was fixed in 2.2-develop branch, but in 2.3-develop branch it's still there.

Looks like this fix was forward ported, but changes overridden by

$requestParams = $this->serviceManager->get('magento-init-params');
$appBootstrapKey = Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS;
if (isset($requestParams[$appBootstrapKey]) && !isset($params[$appBootstrapKey])) {
$params[$appBootstrapKey] = $requestParams[$appBootstrapKey];
}

We'll be really happy if you could investigate and fix it.

I'm closing this Pull Request as described issue already fixed in 2.2-develop branch.

Thank you for you contribution!

@xyzianz
Copy link

xyzianz commented Dec 19, 2019

ping, this is still an issue in Magento 2.3.3

@ihor-sviziev
Copy link
Contributor

ping, this is still an issue in Magento 2.3.3

@Hrafnahnef could you report separate issue on that? It will be checked again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants