mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-05 07:54:35 +02:00
Fix exception with AmountFormatter if Si prefix were enabled and no unit symbol were set.
Also this case is now prevented by Validator (as it is not very useful). Fixes issue #171.
This commit is contained in:
parent
430c9fed67
commit
8338c0f2d6
4 changed files with 94 additions and 86 deletions
|
@ -77,8 +77,9 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
|
|||
|
||||
/**
|
||||
* @var bool Determines if the unit can be used with SI Prefixes (kilo, giga, milli, etc.).
|
||||
* Useful for sizes like meters.
|
||||
* Useful for sizes like meters. For this the unit must be set
|
||||
* @ORM\Column(type="boolean", name="use_si_prefix")
|
||||
* @Assert\Expression("this.isUseSIPrefix() == false or this.getUnit() != null", message="validator.measurement_unit.use_si_prefix_needs_unit")
|
||||
*/
|
||||
protected $use_si_prefix = false;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue