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.

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.