I get the following error when trying to apply the patch.

sh PATCH_SUPEE-7405_CE_1.9.0.1_v1.1-2016-02-23-07-40-19.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
Hunk #1 succeeded at 506 (offset 1 line).
patching file lib/Varien/File/Uploader.php
Hunk #1 FAILED at 216.
Hunk #2 FAILED at 538.
2 out of 2 hunks FAILED -- saving rejects to file lib/Varien/File/Uploader.php.rej

I have tried uploading a fresh copy of lib/Varien/File/Uploader.php from the Magento files but it just shows the exact same error.


Basically, the patch is a find and replace. Here is what you'll find in the .sh :

@@ -216,7 +216,7 @@ class Varien_File_Uploader
         $this->_result = $this->_moveFile($this->_file['tmp_name'], $destinationFile);

         if ($this->_result) {
-            chmod($destinationFile, 0640);
+            chmod($destinationFile, 0666);
             if ($this->_enableFilesDispersion) {
                 $fileName = str_replace(DIRECTORY_SEPARATOR, '/',
                     self::_addDirSeparator($this->_dispretionPath)) . $fileName;
@@ -538,7 +538,7 @@ class Varien_File_Uploader
             $destinationFolder = substr($destinationFolder, 0, -1);

-        if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0750, true))) {
+        if (!(@is_dir($destinationFolder) || @mkdir($destinationFolder, 0777, true))) {
             throw new Exception("Unable to create directory '{$destinationFolder}'.");
         return $this;

The lines with the '-' is what the patch will remove. The lines with the '+' is what the patch will replace.

You'll quickly find where the conflicts are.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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