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

Compatibility with PHP 8.2 #366

Open
fahu opened this issue Aug 1, 2023 · 6 comments
Open

Compatibility with PHP 8.2 #366

fahu opened this issue Aug 1, 2023 · 6 comments

Comments

@fahu
Copy link

fahu commented Aug 1, 2023

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

@TechDriven
Copy link

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,

@JeremyAtMethodMarketing

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?

@Jakub-Czech
Copy link

Jakub-Czech commented Jan 26, 2024

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+

@ootri
Copy link

ootri commented Feb 21, 2024

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;

@JeremyAtMethodMarketing

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.

@SAN1TAR1UM
Copy link

SAN1TAR1UM commented Mar 19, 2024

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: #370 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants