0

I tried to create a custom patch to fix the Magento core bug, but time to install the patch facing the below issue.

patch: **** malformed patch at line 7: - $value[0]['name'] = $value[0]['url'];

Index: vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
diff --git a/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php b/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
--- a/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
+++ b/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
@@ -126,1 +126,8 @@
            $value[0]['url'] = parse_url($value[0]['url'], PHP_URL_PATH);
-           $value[0]['name'] = $value[0]['url'];
+           $value[0]['name'] = $value[0]['name'];
        }

Thank you in advance.

Viral Patel
  • 1,003
  • 1
  • 7
  • 16
Yogesh
  • 1,503
  • 1
  • 18
  • 37

1 Answers1

0
diff --git a/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php b/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
index 3ee2rd..8349152 111644
--- a/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
+++ b/vendor/magento/module-catalog/Model/Category/Attribute/Backend/Image.php
@@ -123,7 +123,7 @@
             // use relative path for image attribute so we know it's outside of category dir when we fetch it
             // phpcs:ignore Magento2.Functions.DiscouragedFunction
             $value[0]['url'] = parse_url($value[0]['url'], PHP_URL_PATH);
-            $value[0]['name'] = $value[0]['url'];
+            $value[0]['name'] = $value[0]['name'];
         }

         if ($imageName = $this->getUploadedImageName($value)) {

Folow this link and create patch via CLI rather than making changes manually.

Yogesh
  • 1,503
  • 1
  • 18
  • 37