// Update image fix
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user