QUESTION:


We are running you Bss_CheckoutCustomField module v1.2.5 on our Magento 2.4.1 store.

 

We are getting the following error on setup:di:compile:

Errors during compilation:

 Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Shipment

  Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/microcloud/domains/refini/domains/refinishing-consumables.co.uk/http/app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Shipment.php

 

 Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Invoice

  Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/microcloud/domains/refini/domains/refinishing-consumables.co.uk/http/app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Invoice.php

 Bss\CheckoutCustomField\Model\Plugin\Sales\Order\Pdf\Creditmemo

  Incompatible argument type: Required type: \Magento\Store\Model\App\Emulation. Actual type: \Magento\Framework\Locale\ResolverInterface; File:

/microcloud/domains/refini/domains/refinishing-consumables.co.uk/http/app/code/Bss/CheckoutCustomField/Model/Plugin/Sales/Order/Pdf/Creditmemo.php


Please tell us how to fix it?


ANSWER:


To fix the incompatible issue with M2.4.1, please edit the files as below:

  • + Model/Plugin/Sales/Order/Pdf/Creditmemo.php


+ Model/Plugin/Sales/Order/Pdf/Invoice.php


+ Model/Plugin/Sales/Order/Pdf/Shipment.php


Or download the attached files below and overwrite the current files on your site.


If you have any other question or concern, please feel free to contact us. We'd be happy to support!