Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Issue with extension attributes in plugin/interceptor #93

Closed
KevinMace opened this issue Nov 29, 2017 · 6 comments
Closed

Issue with extension attributes in plugin/interceptor #93

KevinMace opened this issue Nov 29, 2017 · 6 comments

Comments

@KevinMace
Copy link

KevinMace commented Nov 29, 2017

Preconditions

  1. Magento EE 2.1.7
  2. avalara/avatax 15.5.2
  3. PHP 7.0.8

Steps to reproduce

  1. Attempted to add an item to the cart on a product page

Expected result

  1. Server returns 200 and adds item to the cart

Actual result

  1. Server returns a 500 error, item not added to the cart.

The following error is logged in the apache logs

Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function getTax() on null in /path/to/magento/vendor/classyllama/module-avatax/Plugin/Sales/Total/Quote/CommonTaxCollector.php:43

Which relates to this line of code, the 'getExtensionAttributes' is returning NULL instead of an object.

'extension_attributes' => ['tax' => $rateDataObject->getExtensionAttributes()->getTax()]

@rsisco
Copy link

rsisco commented Nov 29, 2017

@KevinMace - are you still able to reproduce the issue after clearing the Magento cache and performing a DI compile:
bin/magento cache:flush
bin/magento setup:di:compile

Are you able to reproduce the issue on a vanilla Magento 2 install using the latest version of the AvaTax extension? If you can reproduce the issue, please provide specific steps for doing so.

@KevinMace
Copy link
Author

@rsisco Yes, even after clearing the cache, deleting var/generation, var/cache and running the di:compile command the issue was still occurring.

The AvaTax version is the one set in this extensions dependency list in the composer.json, which does appear to be their latest release https://github.com/avadev/AvaTax-Calc-SOAP-PHP/releases

I'll try with a vanilla Magento 2 install and see how that goes.

@KevinMace
Copy link
Author

@rsisco I've been doing some testing using a vanilla Magento EE 2.1.10 install, I can confirm that issue does still occur. These are the steps I went through to recreate the issue.

  1. Within Stores -> Configuration -> General -> Country Options, set the default country to 'United Kindom'

screen shot 2017-11-30 at 21 58 48

  1. Within Stores -> Configuration -> Sales -> Tax, set the following within the 'Default Tax Destination Calculation' section

screen shot 2017-11-30 at 21 57 33

  1. Setup the following tax rate/zone within Stores -> Tax Zones and Rates

screen shot 2017-11-30 at 22 00 31

  1. Setup the following Tax Rule within Stores -> Tax Rules, using the rate/zone we just setup

screen shot 2017-11-30 at 22 01 52

  1. Create a product that uses the Tax Class = "Taxable Goods"

  2. Go to a product page and attempt to add the product to the cart, you should see the following error.

screen shot 2017-11-30 at 22 04 49

[Thu Nov 30 21:51:25.993642 2017] [proxy_fcgi:error] [pid 8594] [client 127.0.0.1:46972] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to a member function getTax() on null in /mnt/project/vendor/classyllama/module-avatax/Plugin/Sales/Total/Quote/CommonTaxCollector.php:43

@rsisco
Copy link

rsisco commented Dec 1, 2017

@KevinMace - Thank you for the update, I am working on reproducing locally and providing a resolution.

@rsisco
Copy link

rsisco commented Dec 4, 2017

@KevinMace - We've released a new version of the extension that addresses this issue. Please update the extension and reopen this issue if needed.
Closing issue.

@rsisco rsisco closed this as completed Dec 4, 2017
@KevinMace
Copy link
Author

@rsisco Great, thank you. I'll install the new version today and see how we get on.

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

No branches or pull requests

2 participants