dolibarr-bugtrack
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dolibarr-bugtrack] [Bug #1639] Translate an empty text return an error


From: Doliforge
Subject: [Dolibarr-bugtrack] [Bug #1639] Translate an empty text return an error value
Date: Sat, 22 Nov 2014 00:24:23 +0100

Doliforge
Is this email not displaying correctly?
update email preferences.

Translate an empty text return an error value

Latest modifications

2014-11-22 00:24 (Europe/Paris)
This report show why we should not return an empty string but an error message. If we return empty string, we return '' when business should use and return 'HT' when key is not defined.
Returning empty string will just return an empty value (so a bad value) instead of showing that caller had made a bugged call.

It is not goal of translation layer to decide that when type of price is not defined, we must use 'HT'.
Changes:
  • Status: 
OpenClosed
  • Assigned to: 
NoneLaurent Destailleur (eldy)
  • Resolution: 
NoneInvalid

Answer now

Snapshot

 Details
Submitted by:  benke (defrance) Submitted on:  2014-11-17 11:02
Last Modified On:  2014-11-17 11:07 
Summary:  Translate an empty text return an error value
Description:  je constate dans la 3.7béta que le problème sur les prix clients multiples a été corrigé d'une manière "élégante"
cela se trouve dans le fichier /htdocs/products/prices.php à partir de la ligne 340
Avant
print price($object->multiprices_min ["$soc->price_level"]) . ' ' . $langs->trans($object->multiprices_base_type ["$soc->price_level"]);
Après
print price($object->multiprices_min["$soc->price_level"]) . ' ' . $langs->trans(empty($object->multiprices_base_type["$soc->price_level"])?'HT':$object->multiprices_base_type["$soc->price_level"]);

et quelques lignes en dessous le soucis est corrigé d'une autre manière
if (empty($object->multiprices_base_type["$i"])) $object->multiprices_base_type["$i"]="HT";

Naturellement, pas de commentaire pour expliciter ses lignes, ça va être cool de maintenir cela ensuite,
Tous cela parceque l'on ne souhaite pas ajouter une seule ligne dans le fichier htodocs/class/translate.class.php

Commence à me gonfler légèrement !
Step to reproduce bug:  
Detected in version:  develop Category:  Core Problem
Severity:  5 - Major OS Type/Version:  
PHP version:   Database type and version:  
 Status
Status:  Closed Assigned to:  Laurent Destailleur (eldy)
Resolution:  Invalid 

Comments

Laurent Destailleur 2014-11-22 00:24
This report show why we should not return an empty string but an error message. If we return empty string, we return '' when business should use and return 'HT' when key is not defined.
Returning empty string will just return an empty value (so a bad value) instead of showing that caller had made a bugged call.

It is not goal of translation layer to decide that when type of price is not defined, we must use 'HT'.
Marcos García 2014-11-17 11:07
Hi Benke,

Sorry for always telling the same but... would you mind reporting bugs in English so that everyone can understand what you mean?

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]