OptionManagement.validateOption throws NoSuchEntityException for "0" option label #13083
Labels
Fixed in 2.2.x
The issue has been fixed in 2.2 release line
Fixed in 2.3.x
The issue has been fixed in 2.3 release line
Issue: Clear Description
Gate 2 Passed. Manual verification of the issue description passed
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: Format is valid
Gate 1 Passed. Automatic verification of issue format passed
Issue: Ready for Work
Gate 4. Acknowledged. Issue is added to backlog and ready for development
Reproduced on 2.2.x
The issue has been reproduced on latest 2.2 release
Reproduced on 2.3.x
The issue has been reproduced on latest 2.3 release
Preconditions
Steps to reproduce
Expected result
Actual result
NoSuchEntityException
with messageAttribute <somecode> does not contain option with Id <someId>
is thrownRoot cause
There is

validateOption
method inOptionManagement.php
that checks if option exists:getOptionText
returns "0" string as it is supposed to:So the root cause is in
validateOption
method (see the first screenshot). In line 135 it does logical NOT operator, so "0" is casted to FALSE, thus the condition is TRUE. To fix the issue the comparison should be exact:=== FALSE
.The text was updated successfully, but these errors were encountered: