Closed CanBeer closed 1 year ago
I don't recommend using the 'dispatch now' nor 'run cron' features. These both run the scheduled tasks in the wrong context, which is the cause of the bug you're describing here.
If you want to trigger a job to run "now", I recommend using the 'schedule job' feature instead.
@fredden Thanks for the workaround.
Version 2.0.0 has now been released, which includes #193 which removes the problem feature.
Describe the bug
We have a
sync_import_order
cron which allows us to create the shipment and capture the order. Therefore, there is an invoice and shipment email send.The cron starts as follows:
I have no problem, if I run the cron in cli like this:
php8.1 bin/magento cronmanager:runjob sync_import_order
On the other hand, if I launch it from the back office with the button "Dispatch now", I got this error:
During the generation of the PDF invoice attachment, Magento try to load the
Magento_Payment::info/pdf/default.phtml
frontend template, but initially the area is ADMINHTML, and he can't load it in the backend theme.Have you ever noticed this problem? I don't know if it's a Magento problem or related to your module.
Expected behavior
We need to have the same behaviour as the cli.
Environment (please complete the following information):