diff --git a/src/Entity/Parts/MeasurementUnit.php b/src/Entity/Parts/MeasurementUnit.php
index d8c97756..bd0f1648 100644
--- a/src/Entity/Parts/MeasurementUnit.php
+++ b/src/Entity/Parts/MeasurementUnit.php
@@ -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;
diff --git a/src/Services/AmountFormatter.php b/src/Services/AmountFormatter.php
index 371389b3..26cd26d9 100644
--- a/src/Services/AmountFormatter.php
+++ b/src/Services/AmountFormatter.php
@@ -131,7 +131,8 @@ class AmountFormatter
/** @var MeasurementUnit $unit */
$unit = $options['measurement_unit'];
- return $unit->getUnit();
+ //When no unit is set, return empty string so that this can be formatted properly
+ return $unit->getUnit() ?? '';
}
return '';
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf
index f586d266..b2f7a6d5 100644
--- a/translations/messages.en.xlf
+++ b/translations/messages.en.xlf
@@ -893,9 +893,9 @@ The user will have to set up all two-factor authentication methods again and pri
entity.delete.message
- This can not be undone!
-<br>
-Sub elements will be moved upwards.
+
+Sub elements will be moved upwards.]]>
@@ -9316,457 +9316,457 @@ Element 3
-
+ user.pw_change_needed.flashYour password needs to be changed! Please set a new password.
-
+ tree.root_node.textRoot node
-
+ part_list.action.select_nullNo elements existing!
-
+ part_list.action.delete-titleDo you really want to delete these parts?
-
+ part_list.action.delete-messageThese parts and any associated information (like attachments, price information, etc.) will be deleted. This can not be undone!
-
+ part.table.actions.successActions finished successfully.
-
+ attachment.edit.delete.confirmDo you really want to delete this attachment?
-
+ filter.text_constraint.value.operator.EQIs
-
+ filter.text_constraint.value.operator.NEQIs not
-
+ filter.text_constraint.value.operator.STARTSStarts with
-
+ filter.text_constraint.value.operator.CONTAINSContains
-
+ filter.text_constraint.value.operator.ENDSEnds with
-
+ filter.text_constraint.value.operator.LIKELIKE pattern
-
+ filter.text_constraint.value.operator.REGEXRegular expression
-
+ filter.number_constraint.value.operator.BETWEENBetween
-
+ filter.number_constraint.ANDand
-
+ filter.entity_constraint.operator.EQIs (excluding children)
-
+ filter.entity_constraint.operator.NEQIs not (excluding children)
-
+ filter.entity_constraint.operator.INCLUDING_CHILDRENIs (including children)
-
+ filter.entity_constraint.operator.EXCLUDING_CHILDRENIs not (excluding children)
-
+ part.filter.dbIdDatabase ID
-
+ filter.tags_constraint.operator.ANYAny of the tags
-
+ filter.tags_constraint.operator.ALLAll of the tags
-
+ filter.tags_constraint.operator.NONENone of the tags
-
+ part.filter.lot_countNumber of lots
-
+ part.filter.attachments_countNumber of attachments
-
+ part.filter.orderdetails_countNumber of orderdetails
-
+ part.filter.lotExpirationDateLot expiration date
-
+ part.filter.lotNeedsRefillAny lot needs refill
-
+ part.filter.lotUnknwonAmountAny lot has unknown amount
-
+ part.filter.attachmentNameAttachment name
-
+ filter.choice_constraint.operator.ANYAny of
-
+ filter.choice_constraint.operator.NONENone of
-
+ part.filter.amount_sumTotal amount
-
+ filter.submitUpdate
-
+ filter.discardDiscard changes
-
+ filter.clear_filtersClear all filters
-
+ filter.titleFilter
-
+ filter.parameter_value_constraint.operator.=Typ. Value =
-
+ filter.parameter_value_constraint.operator.!=Typ. Value !=
-
+ filter.parameter_value_constraint.operator.<
- Typ. Value <
+
-
+ filter.parameter_value_constraint.operator.>
- Typ. Value >
+ ]]>
-
+ filter.parameter_value_constraint.operator.<=
- Typ. Value <=
+
-
+ filter.parameter_value_constraint.operator.>=
- Typ. Value >=
+ =]]>
-
+ filter.parameter_value_constraint.operator.BETWEENTyp. Value is between
-
+ filter.parameter_value_constraint.operator.IN_RANGEIn Value range
-
+ filter.parameter_value_constraint.operator.NOT_IN_RANGENot in Value range
-
+ filter.parameter_value_constraint.operator.GREATER_THAN_RANGEGreater than Value range
-
+ filter.parameter_value_constraint.operator.GREATER_EQUAL_RANGEGreater equal than Value range
-
+ filter.parameter_value_constraint.operator.LESS_THAN_RANGELess than Value range
-
+ filter.parameter_value_constraint.operator.LESS_EQUAL_RANGELess equal than Value range
-
+ filter.parameter_value_constraint.operator.RANGE_IN_RANGERange is completly in Value range
-
+ filter.parameter_value_constraint.operator.RANGE_INTERSECT_RANGERange intersects Value range
-
+ filter.text_constraint.valueNo value set
-
+ filter.number_constraint.value1No value set
-
+ filter.number_constraint.value2Maximum value
-
+ filter.datetime_constraint.value1No datetime set
-
+ filter.datetime_constraint.value2Maximum datetime
-
+ filter.constraint.addAdd constraint
-
+ part.filter.parameters_countNumber of parameters
-
+ part.filter.lotDescriptionLot description
-
+ parts_list.search.searching_for
- Searching parts with keyword <b>%keyword%</b>
+ %keyword%]]>
-
+ parts_list.search_options.captionEnabled search options
-
+ attachment.table.element_typeAssociated element type
-
+ log.level.debugDebug
-
+ log.level.infoInfo
-
+ log.level.noticeNotice
-
+ log.level.warningWarning
-
+ log.level.errorError
-
+ log.level.criticalCritical
-
+ log.level.alertAlert
-
+ log.level.emergencyEmergency
-
+ log.type.securitySecurity related event
-
+ log.type.instock_changed[LEGACY] Instock changed
-
+ device_part.labelDevice part
-
+ log.target_idTarget element ID
diff --git a/translations/validators.en.xlf b/translations/validators.en.xlf
index 9f81c4d0..cccb2bb7 100644
--- a/translations/validators.en.xlf
+++ b/translations/validators.en.xlf
@@ -227,5 +227,11 @@
You must select an supplier!
+
+
+ validator.measurement_unit.use_si_prefix_needs_unit
+ To enable SI prefixes, you have to set a unit symbol!
+
+