Open Triyugi opened 7 years ago
This issue I was getting on Magento 1.9.2.2 because there is no unEscapeCSVData
method in app/code/core/Mage/Core/Helper/Data.php.
Create a local Data.php
and add two methods from Magento 1.9.2.4 as below:
public function getEscapedCSVData(array $data)
{
if (Mage::getStoreConfigFlag(Mage_ImportExport_Model_Export_Adapter_Csv::CONFIG_ESCAPING_FLAG)) {
foreach ($data as $key => $value) {
$value = (string)$value;
$firstLetter = substr($value, 0, 1);
if ($firstLetter !== false and in_array($firstLetter, array("=", "+", "-"))) {
$data[$key] = ' ' . $value;
}
}
}
return $data;
}
public function unEscapeCSVData($data)
{
if (is_array($data) and Mage::getStoreConfigFlag(Mage_ImportExport_Model_Export_Adapter_Csv::CONFIG_ESCAPING_FLAG)) {
foreach ($data as $key => $value) {
$value = (string)$value;
if (preg_match("/^ [=\-+]/", $value)) {
$data[$key] = ltrim($value);
}
}
}
return $data;
}
And then I have to define CONFIG_ESCAPING_FLAG
in app/code/local/ImportExport/Model/Import/Adapter/Csv.php
and in app/code/local/ImportExport/Model/Export/Adapter/Csv.php
as below:
class Mage_ImportExport_Model_Export_Adapter_Csv extends Mage_ImportExport_Model_Export_Adapter_Abstract
{
const CONFIG_ESCAPING_FLAG = 'system/export_csv/escaping';
This is not resolved as it is only solved locally.
@avstudnitz Then, what should I do?
Either provide a pull request, or do nothing and wait until someone else provides a fix which can be included in the module.
@Triyugi: you are correct, it is related to SUPEE-7405. The code was introduced in this PR: https://github.com/avstudnitz/AvS_FastSimpleImport/pull/278
Have you installed SUPEE-7405 on your Magento 1.9.2.2 installation? If not, then please install it, it should fix the problem (and please install all the other security patches as well which you might not have installed yet).
I am getting following error:
How it can be resolved. Is it related to SUPEE-7405?