magento2: 2.4.0 Can't edit attributes possible Temando Shipping related

Preconditions (*)

  1. 2.4.0
  2. Stores>Attributes>Product>Click attribute
  3. I have upgraded from 2.3.4

Steps to reproduce (*)

  1. When clicking on attribute receiving an error, my wild guess its related to Temando Shipping being removed in 2.3.5
  2. It happens with all attributes whether its default attributes or custom attributes.
  3. It happens also if you click “Add attribute”

Expected result (*)

  1. [Screenshots, logs or description]
  2. Edit attribute window

Actual result (*)

  1. [Screenshots, logs or description]
  2. Getting this error

Call to undefined method Magento\Framework\Json\Helper\Data::getAttributeHiddenFields() in /data/www/pneumatig/vendor/magento/module-catalog/view/adminhtml/templates/catalog/product/attribute/js.phtml:216

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Here’s a patch I created to use with vaimo/composer-packages;

Fix can't edit product attributes due to missing method getAttributeHiddenFields

@package magento/module-catalog
@level 0
@link https://github.com/magento/magento2/issues/30277

diff --git view/adminhtml/templates/catalog/product/attribute/js.phtml view/adminhtml/templates/catalog/product/attribute/js.phtml
index 8dde701..81abb96 100644
--- view/adminhtml/templates/catalog/product/attribute/js.phtml
+++ view/adminhtml/templates/catalog/product/attribute/js.phtml
@@ -213,7 +213,7 @@ function switchDefaultValueField()
             setRowVisibility('frontend_class', false);
         break;
 script;
-foreach ($jsonHelper->getAttributeHiddenFields() as $type => $fields):
+foreach ($this->helper(Magento\Catalog\Helper\Data::class)->getAttributeHiddenFields() as $type => $fields):
             $scriptString .= <<<script
             case '{$block->escapeJs($type)}':
                 var isFrontTabHidden = false;

Same error migrating from 2.4.1 to 2.4.2. I solved with @peterjaap patch. (Thank you 😃 Is not related with Temando However the inconsistency on the class position is evident with a quick glance. The error appears only if Magento_Swatches module is disabled. This module override the wrong template with his own (which is correct).

Thank @antoniocarboni Your answer is helpful for me. Its solve my issue.

problem still persists… fix this, why is whole thing crashing when you disable 1 module, that should absolutelly not happen