From 2d1d097b39bdd94ef6e929c34fc721113a3505ea Mon Sep 17 00:00:00 2001 From: "Zeno F. Pensky" Date: Mon, 7 Sep 2020 12:55:02 +0200 Subject: [PATCH] Fix #29879 Breadcrump Undefined class constant 'XML_PATH_CATEGORY_URL_SUFFIX' When creating a plugin, that is calling the public functions for the product breadcrump they ending up throwing an error message, because this constants has been marked as private recently. This is fixing it with referencing to the current instance and all is working again. This fix is analog to another bug of the same type: https://github.com/magento/magento2/issues/28981 https://github.com/magento/magento2/pull/28797 This should resolve: https://github.com/magento/magento2/issues/29879 --- app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php index d3c8c406ee34d..2aa30fb18fdf4 100644 --- a/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php +++ b/app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php @@ -71,7 +71,7 @@ public function __construct( public function getCategoryUrlSuffix() { return $this->scopeConfig->getValue( - static::XML_PATH_CATEGORY_URL_SUFFIX, + self::XML_PATH_CATEGORY_URL_SUFFIX, ScopeInterface::SCOPE_STORE ); } @@ -84,7 +84,7 @@ public function getCategoryUrlSuffix() public function isCategoryUsedInProductUrl(): bool { return $this->scopeConfig->isSetFlag( - static::XML_PATH_PRODUCT_USE_CATEGORIES, + self::XML_PATH_PRODUCT_USE_CATEGORIES, ScopeInterface::SCOPE_STORE ); }