QUESTION:
I upgraded the module to v1.2.5 for my site Magento 2.2.10, when I clicked "view" order, I got error as below:
Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Sales\Model\Order\Invoice::setExtensionAttributes() must implement interface Magento\Sales\Api\Data\InvoiceExtensionInterface, instance of Magento\Sales\Api\Data\OrderExtension given, called in /var/xxxx/xxxx/xxxxx/app/code/Bss/CheckoutCustomField/Model/Observer/Sales/CustomFieldHelper.php on line 94 and defined in /var/xxxxx/xxxxx/xxxx/vendor/magento/module-sales/Model/Order/Invoice.php:1620 Stack trace: #0 /var/xxxx/xxxx/xxxx/app/code/Bss/CheckoutCustomField/Model/Observer/Sales/CustomFieldHelper.php(94): Magento\Sales\Model\Order\Invoice->setExtensionAttributes(Object(Magento\Sales\Api\Data\OrderExtension)) #1 /varxxxx/xxxx/xxxx/app/code/Bss/CheckoutCustomField/Model/Observer/Sales/InvoiceLoadAfter.php(61): Bss\CheckoutCustomField\Model\Observer\Sales\CustomFieldHelper->executeSetExtensionAttributes(Object(Magento\Sales\Model\Order\Interceptor), Object(Magento\Sales\Mod in /var/www/xxxxxx/xxxxxx/xxxxxx/vendor/magento/module-sales/Model/Order/Invoice.php on line 1620
Please tell me how to fix it?
ANSWER:
This error only appears on M2.2.x, to fix this error, please edit file app/code/Bss/CheckoutCustomField/Model/Observer/Sales/CustomFieldHelper.php as below:

Or download the attached file below and overwrite the current file on your site.
If you need further assistance, please don't hesitate to contact us. Don't forget that BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.
Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.
Our most powerful extensions are BSS Commerce’s Magento 2 B2B Extension & BSS Commerce’s Magento 2 SEO Extension
Please visit our site for more useful Magento 2 Extensions: https://bsscommerce.com/magento-2-extensions.html
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article