taxjar-magento2-extension icon indicating copy to clipboard operation
taxjar-magento2-extension copied to clipboard

Compatibility with PHP 8.2

Open fahu opened this issue 1 year ago • 6 comments

Description

When creating a credit memo the following error is thrown: Creation of dynamic property Taxjar\SalesTax\Model\Transaction\Order::$apiKey is deprecated. image

Steps to Reproduce

  1. Create a new order
  2. Wait until the order gets in status "processing"
  3. Create a credit memo

Versions

TaxJar module 2.1.0 Magento 2.4.6 PHP 8.2

fahu avatar Aug 01 '23 08:08 fahu

Hi @sethobey, @fastdivision

Can we have any update on this? We have updated the PHP version to 8.2 and now we getting the same issue including other one like:

1 exception(s):
Exception #0 (Exception): Deprecated Functionality: Creation of dynamic property Taxjar\SalesTax\Model\Import\Rate::$_calculationFactory is deprecated in /vendor/taxjar/module-taxjar/Model/Import/Rate.php on line 100 

Thank you,

TechDriven avatar Nov 05 '23 06:11 TechDriven

I am also getting this deprecation notice on magento 2.4.6-p1 with taxjar/module 2.2.0 with php 8.1-fpm.

It is being displayed to customers which is causing an issue for our client. They are reporting an increase in customer service calls because customers are unsure if their orders are being processed. Is there anyone working on this?

JeremyAtMethodMarketing avatar Nov 30 '23 21:11 JeremyAtMethodMarketing

I have the same issue. Module's composer.json of the newest version does not have requirements for PHP version and there is a lot of deprecated functionalities in the module which results in error messages if we use PHP 8.1+

Jakub-Czech avatar Jan 26 '24 12:01 Jakub-Czech

These can be fixed very easily, although it's odd nobody at TaxJar made these fixes for such a long time.

In file: ./vendor/taxjar/module-taxjar/Model/Transaction/Order.php Towards the top of the file, but inside the class, add this line: protected $apiKey;

In file: ./vendor/taxjar/module-taxjar/Model/Transaction/Refund.php Same general area, add: protected $apiKey;

In file: ./vendor/taxjar/module-taxjar/Model/Import/Rate.php Add: protected $_calculationFactory;

ootri avatar Feb 21 '24 00:02 ootri

Thank you, also i would recommend that you instead add

protected $apiKey;

to /vendor/taxjar/module-taxjar/Model/Transaction.php

because bother order and refund inherit that class so you only need to add it in one place.

JeremyAtMethodMarketing avatar Feb 21 '24 00:02 JeremyAtMethodMarketing

It it highly frowned upon to modify the core files directly, there are many good reasons for this. You should implement these changes in a(some) composer patch(es) to be applied at deployment. See example here: https://github.com/taxjar/taxjar-magento2-extension/issues/370#issuecomment-2005567145

SAN1TAR1UM avatar Mar 19 '24 01:03 SAN1TAR1UM