I am running Magento version 1.9.2.0 and I am trying to install patch 7405 v1.1 with "PATCH_SUPEE-7405_CE_1.9.2.0_v1.1-2016-02-23-07-41-47.sh" but I am getting an error patching. Below is the error I am getting
sh PATCH_SUPEE-7405_CE_1.9.2.0_v1.1-2016-02-23-07-41-47.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
Hunk #1 FAILED at 121. 1 out of 1 hunk Failed -- saving rejects to file app/code/core/Mage/Adminhtml/Helper/Sales.php.rej
patching file app/code/core/Mage/Core/Model/Config.php patching file
app/code/core/Mage/Sales/Model/Quote/Item.php
patching file lib/Varien/File/Uploader.php
The previous version(7405 v1) was installed by my developer who said he never change the core file manually which I think is a lie because I checked the core file and noticed $links = array(); was added :
if (!empty($data) && is_array($allowedTags) && in_array('a', $allowedTags)) {
#$links = [];
$links = array();
$i = 1;
$data = str_replace('%', '%%', $data);
$regexp = "/<a\s[^>]*href\s*?=\s*?([\"\']??)([^\" >]*?)\\1[^>]*>(.*)<\/a>/siU";
while (preg_match($regexp, $data, $matches)) {
//Revert the sprintf escaping
$url = str_replace('%%', '%', $matches[2]);
$text = str_replace('%%', '%', $matches[3]);
//Check for an valid url
if ($url) {
$urlScheme = strtolower(parse_url($url, PHP_URL_SCHEME));
if ($urlScheme !== 'http' && $urlScheme !== 'https') {
$url = null;
}
}
//Use hash tag as fallback
if (!$url) {
$url = '#';
}
//Recreate a minimalistic secure a tag
$links[] = sprintf(
'<a href="%s">%s</a>',
htmlspecialchars($url, ENT_QUOTES, 'UTF-8', false),
parent::escapeHtml($text)
);
$data = str_replace($matches[0], '%' . $i . '$s', $data);
++$i;
}
$data = parent::escapeHtml($data, $allowedTags);
return vsprintf($data, $links);
}
return parent::escapeHtml($data, $allowedTags);
}
}
I have delete $links = array(); and remove # in front of the (#$links = [];) but still given the same error.
I checked app/etc/ folder for "applied.patches.list" but there is no file with that name, I noticed there is "PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh" in my Magento folder which I believe is the file he used to patch. My question is can you use a patch with version 1.9.2.2 on Magento version 1.9.2.0? Do I need to download "PATCH_SUPEE-7405_CE_1.9.2.2_v1.1-2016-02-23-07-41-47.sh" instead of "PATCH_SUPEE-7405_CE_1.9.2.0_v1.1-2016-02-23-07-41-47.sh" to solve the problem?
Any help please?
app/code/core/Mage/Adminhtml/Helper/Sales.php file?and do I patch with the version 1.9.2.0 or download one for version 1.9.2.2 since I believe my developer patched withPATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh– Tank Mar 10 '16 at 00:09app/code/core/Mage/Adminhtml/Helper/Sales.phpfile. The question I have is, since this is a fresh file from 2015 it will not have any patch applied to it so do I have to reapply SUPEE 7405 v1 then 7405 v1.1 or just apply the SUPEE 7405 v1.1 then it will be ok. – Tank Mar 10 '16 at 01:37app/code/core/Mage/Adminhtml/Helper/Sales.phpwill not have 7405 v1 patched to it. Sorry what I mean is do I replace the sales.php then just patch with the 7405v1.1? Thank you – Tank Mar 10 '16 at 02:03Sales.php, if not you can replace, if it had then you have to make changes manually then apply 7405 v1. – Adarsh Khatri Mar 10 '16 at 02:10Patch applied/reverted successfully. last question, do I need to run any other command like thechown -R web-server-user-nameor that is it? Thank you – Tank Mar 10 '16 at 13:29