You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This setting should make sure, that Magento always recognizes, that the pub folder is the root directory.
We now added a custom cronjob, which sends out the regular Magento invoice email again.
Running this cronjob with magerun sys:cron:run sends out the email, but adds /pub/ to the logo url, so the logo can not be found anymore, as the root directory is already the pub directory.
So if the the logo is placed directly in the media folder and can be found under https://www.base-url/media/logo.png, the following url is given instead: https://www.base-url/pub/media/logo.png.
When I run the same cronjob using bin/magento, the media url is found and the logo is inserted correctly.
I debugged this a bit and found out, that \Magento\Framework\App\Filesystem\DirectoryListis not initialized correctly using n98magerun in this case.
To check for the config option mentioned earlier the function \Magento\Framework\Console\Cli::documentRootResolver is needed.
Would be great, if there would be a way to fix that, so that the output is actually the same as in the automatic cronjob.
The text was updated successfully, but these errors were encountered:
To reproduce this issue, use the pub folder as root directory.
Following the Magento devdocs, we insert the following code in
app/etc/env.php
:'directories' => [ 'document_root_is_pub' => true ]
see https://devdocs.magento.com/guides/v2.3/config-guide/prod/config-reference-envphp.html#directories and https://devdocs.magento.com/guides/v2.3/install-gde/tutorials/change-docroot-to-pub.html#3-update-the-envphp-file as reference.
This setting should make sure, that Magento always recognizes, that the pub folder is the root directory.
We now added a custom cronjob, which sends out the regular Magento invoice email again.
Running this cronjob with
magerun sys:cron:run
sends out the email, but adds/pub/
to the logo url, so the logo can not be found anymore, as the root directory is already the pub directory.So if the the logo is placed directly in the media folder and can be found under https://www.base-url/media/logo.png, the following url is given instead: https://www.base-url/pub/media/logo.png.
When I run the same cronjob using
bin/magento
, the media url is found and the logo is inserted correctly.I debugged this a bit and found out, that
\Magento\Framework\App\Filesystem\DirectoryList
is not initialized correctly using n98magerun in this case.To check for the config option mentioned earlier the function
\Magento\Framework\Console\Cli::documentRootResolver
is needed.Would be great, if there would be a way to fix that, so that the output is actually the same as in the automatic cronjob.
The text was updated successfully, but these errors were encountered: