Closed GregRbs92 closed 3 years ago
This sounds like a reasonable thing to do. What you like to implement the change @GregRbs92?
Although to be on par with true/false handling I'd give up on the strtolower
call
@malarzm With pleasure, do you have any contribution guide I can refer to for the development?
@GregRbs92 depends what you're looking for :) but bare minimum is to add a test along with the change, so we won't break added behaviour accidentally. If you don't have MongoDB installed locally you can count on running tests through GitHub actions, that's happening for each commit. Also we have automated checks for coding standards and static analysis, so if there's anything off with our standards, the checks will let you know. So summing up:
2.1.x
branch as you're fixing a bugnull
handling along with test that proves this works as intended
Bug Report
Summary
I wanted to create an index with a partial filter expression to index only the documents having a specific field set to
null
. Unfortunately, when using the XML mapping, the values are cast asstring
, therefore the index is created for the documents having the specific field set to the string"null"
.Current behavior
Currently, only booleans and numbers are handled as specific types. https://github.com/doctrine/mongodb-odm/blob/3bdfe97be472160ebbc924d5882ce61bd640a515/lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php#L525-L531
How to reproduce
Expected behavior
Adding an exception for null values might be useful.