// Update image fix

This commit is contained in:
Jerome Nadaud
2013-10-18 17:50:36 +02:00
parent 964f546b0b
commit 1bee0087c0

View File

@@ -202,6 +202,22 @@ class AdminGendersControllerCore extends AdminController
}
return !count($this->errors) ? true : false;
}
protected function afterImageUpload()
{
parent::afterImageUpload();
if (($id_gender = (int)Tools::getValue('id_gender')) &&
isset($_FILES) && count($_FILES) && file_exists(_PS_GENDERS_DIR_.$id_gender.'.jpg'))
{
$current_file = _PS_TMP_IMG_DIR_.'gender_mini_'.$id_gender.'_'.$this->context->shop->id.'.jpg';
if (file_exists($current_file))
unlink($current_file);
}
return true;
}
}