[-] BO: Fix listing exports with image or other empty fields
This commit is contained in:
@@ -588,16 +588,27 @@ class AdminControllerCore extends Controller
|
|||||||
$headers = array();
|
$headers = array();
|
||||||
foreach ($this->fields_list as $datas)
|
foreach ($this->fields_list as $datas)
|
||||||
$headers[] = Tools::htmlentitiesDecodeUTF8($datas['title']);
|
$headers[] = Tools::htmlentitiesDecodeUTF8($datas['title']);
|
||||||
|
|
||||||
$content = array();
|
$content = array();
|
||||||
foreach ($this->_list as $i => $row)
|
foreach ($this->_list as $i => $row)
|
||||||
{
|
{
|
||||||
$content[$i] = array();
|
$content[$i] = array();
|
||||||
foreach ($this->fields_list as $key => $value)
|
$path_to_image = false;
|
||||||
if (isset($row[$key]))
|
foreach ($this->fields_list as $key => $params)
|
||||||
$content[$i][] = Tools::htmlentitiesDecodeUTF8($row[$key]);
|
{
|
||||||
|
$field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8($row[$key]) : '';
|
||||||
|
if ($key == 'image')
|
||||||
|
{
|
||||||
|
if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES'))
|
||||||
|
$path_to_image = Tools::getShopDomain(true)._PS_IMG_.$params['image'].'/'.$row['id_'.$this->table].(isset($row['id_image']) ? '-'.(int)$row['id_image'] : '').'.'.$this->imageType;
|
||||||
|
else
|
||||||
|
$path_to_image = Tools::getShopDomain(true)._PS_IMG_.$params['image'].'/'.Image::getImgFolderStatic($row['id_image']).(int)$row['id_image'].'.'.$this->imageType;
|
||||||
|
if ($path_to_image)
|
||||||
|
$field_value = $path_to_image;
|
||||||
|
}
|
||||||
|
$content[$i][] = $field_value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->context->smarty->assign(array(
|
$this->context->smarty->assign(array(
|
||||||
'export_precontent' => "\xEF\xBB\xBF",
|
'export_precontent' => "\xEF\xBB\xBF",
|
||||||
'export_headers' => $headers,
|
'export_headers' => $headers,
|
||||||
|
|||||||
Reference in New Issue
Block a user