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
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
After upgrading from 2.3.5-p1 to 2.3.6 an undocumented breaking change was introduced to the \Magento\Sales\Model\Order\Pdf\Invoice class. This prevents invoices from being printed if the class has been extended.
public function __construct(
....
\Magento\Framework\Locale\ResolverInterface $localeResolver,
....
public function getPdf($invoices = []) {
..............
if ($invoice->getStoreId()) {
$this->_localeResolver->emulate($invoice->getStoreId());
$this->_storeManager->setCurrentStore($invoice->getStoreId());
}
.........
if ($invoice->getStoreId()) {
$this->_localeResolver->revert();
}
After (2.3.6):
/**
* @var \Magento\Store\Model\App\Emulation
*/
private $appEmulation;
public function __construct(
....
\Magento\Store\Model\App\Emulation $appEmulation,
....
if ($invoice->getStoreId()) {
$this->appEmulation->startEnvironmentEmulation(
$invoice->getStoreId(),
\Magento\Framework\App\Area::AREA_FRONTEND,
true
);
$this->_storeManager->setCurrentStore($invoice->getStoreId());
}
......................
if ($invoice->getStoreId()) {
$this->appEmulation->stopEnvironmentEmulation();
}
Because of this change and the introduction of a private function, extending this class has significantly changed.
Proposed solution
Ensure breaking changes are documented
Severity: S3- Affects non-critical data or functionality and does not force users to employ a workaround.