Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento Order view critical error #327

Open
dainiusgliebus opened this issue Jan 31, 2019 · 0 comments
Open

Magento Order view critical error #327

dainiusgliebus opened this issue Jan 31, 2019 · 0 comments

Comments

@dainiusgliebus
Copy link

dainiusgliebus commented Jan 31, 2019

Version 3.0 & 3.1

Issue when trying to view magento order and order do not contain Channel.

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Call to a member function getTransport() on null" at /vendor/oro/crm/src/Oro/Bundle/MagentoBundle/Twig/OrderNotesExtension.php line 33 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Call to a member function getTransport() on null at /vendor/oro/crm/src/Oro/Bundle/MagentoBundle/Twig/OrderNotesExtension.php:33)"} []

if ($entity instanceof IntegrationAwareInterface) {
            // quick fix below probably can find better solution
            if(null === $entity->getChannel()){
                return false;
            }
            /** @var MagentoTransport $magentoTransport */
            $magentoTransport = $entity->getChannel()->getTransport();
            $isSupportedOrderNoteFunctionality = $magentoTransport->isSupportedOrderNoteExtensionVersion();
            $isDisplayOnAccountOrCustomerPage = $magentoTransport->getIsDisplayOrderNotes();
            if ($isSupportedOrderNoteFunctionality && ($isDisplayOnAccountOrCustomerPage || $entity instanceof Order)) {
                return true;
            }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant