- ๐ฎ๐ณIndia vinay.p
vinay.p โ made their first commit to this issueโs fork.
- Merge request !334Add validation constraint to make order_number not required only in the draft state โ (Open) created by vinay.p
- Status changed to Needs review
11 months ago 6:54am 18 September 2024 - ๐ฎ๐ฑIsrael jsacksick
Do we really have to load the order afresh from the DB? This can be quite expensive in terms of performance... I'd prefer to avoid that if possible...
- ๐ฎ๐ณIndia vinay.p
OrderVersion constraint already loads unchanged entity anyways. If it caches it (does it?) then doing the same in OrderNumber constraint might be harmless.
Unrelated to the patch:
I looked into it again and it seems like if we set order_number to FALSE, it does accept it for some reason. I tried step debugging all the way through and found the probable culprit in NotNullConstraintValidator and specifically in the isEmpty method of StringItemBase. It doesn't seem to consider FALSE as an empty string value.Passing FALSE in order_number does feel a bit awkward and kind of a hack, even though it does seem to end up as an empty string afterwards. Thoughts?