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

Doesn't work when $eavAttribute->getDefaultFrontendLabel() is null #84

Closed
elfeffe opened this issue Oct 15, 2019 · 9 comments
Closed

Doesn't work when $eavAttribute->getDefaultFrontendLabel() is null #84

elfeffe opened this issue Oct 15, 2019 · 9 comments
Assignees

Comments

@elfeffe
Copy link

elfeffe commented Oct 15, 2019

When I go to Sales - Tax I get a white screen.
And error log says we are trying to setLabel on null.
Seems to be a problem with some attribute, and I think it's this one customer.custom.mgs_social_fid

PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Vertex\Tax\Model\FlexField\FlexFieldProcessableAttribute::setLabel() must be of the type string, null given

@elfeffe elfeffe changed the title Doesn't work with 2.3.3 Doesn't work when $eavAttribute->getDefaultFrontendLabel() is null Oct 15, 2019
@elfeffe
Copy link
Author

elfeffe commented Oct 15, 2019

This is the problem

$eavAttribute->getDefaultFrontendLabel()

Sometimes that returns null, and the extension doesn't work at all.
Not related to 2.3.3, but a bug

@ryanreeves-taxjar
Copy link
Contributor

Thanks for reporting this issue @elfeffe. We'll take a look into it and let you know what we find!

@alex91ckua
Copy link

Temporary fix:
UPDATE eav_attribute set frontend_label='' WHERE frontend_label is NULL;

@sumeet-synergytop
Copy link

sumeet-synergytop commented Jan 29, 2020

@elfeffe @ryanreeves-taxjar
how to fix this issues ?
i am also getting this error - Uncaught TypeError: Argument 1 passed to Vertex\Tax\Model\FlexField\FlexFieldProcessableAttribute::setLabel() must be of the type string, null given
would please anyone here how to solve this ?

@ryanreeves-taxjar
Copy link
Contributor

@elfeffe @sumeet-synergytop It looks like that error is originating in the Vertex extension. Could you please try disabling that extension to see if it resolves the error?

@sumeet-synergytop
Copy link

@ryanreeves-taxjar
Okay
If we are disabling vertex extension then what about vertex functionality?

@ryanreeves-taxjar
Copy link
Contributor

@sumeet-synergytop We don't recommend using Vertex concurrently with our extension. If you have additional questions around this, please email our support team at support@taxjar.com.

@elfeffe
Copy link
Author

elfeffe commented Jan 30, 2020 via email

@fastdivision
Copy link
Member

@elfeffe Can you elaborate on the fix you used here specifically in the TaxJar extension? The error appears to come from the Vertex extension, which is bundled into Magento core. Please review the patch provided in this issue:

Index: vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php	(revision 21bce02860fb6a0661f434dc38527664aaa7dded)
+++ vendor/vertex/module-tax/Model/FlexField/Extractor/EavAttributeExtractor.php	(date 1574367021765)
@@ -119,7 +119,7 @@
             $attribute = $this->attributeFactory->create();
             $attributeCode = $prefix . '.' . $eavAttribute->getAttributeCode();
             $attribute->setAttributeCode($attributeCode);
-            $attribute->setLabel($eavAttribute->getDefaultFrontendLabel());
+            $attribute->setLabel($eavAttribute->getDefaultFrontendLabel() ?: $eavAttribute->getAttributeCode());
             $attribute->setOptionGroup(__($optionGroup)->render());
             $attribute->setType($type);
             $attribute->setProcessor($processor);

If anyone using Vertex as their calculation engine needs a fix. Disabling the module also works well if you are not using Vertex as your calculation engine.

A fully tested and proper fix should be included with Magento 2.3.4

It appears this issue was fixed in v3.0.0 of the Vertex module bundled in Magento 2.3.4.

Thank you!

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

5 participants