Open
Description
Package version (if known): 5+
Describe the bug
The EDTFDateStringCF
dump and load methods do not allow for multiple values.
The dump method currently iterates through a loop, but overwrites the single value, resulting in the last value in the loop being set as the single value (see here).
This means that if an EDTFDateStringCF has multiple values, the last value will be set, e.g.:
"mex:start": {
"date": "1921-08-10",
"date_range": {
"gte": "1921-08-10",
"lte": "1921-08-10"
}
},
The output from an internal query would be:
['1', '9', '2', '1', '-', '0', '8', '-', '1', '0']
since, if it is a multiple field, it expects an array of values.
Steps to Reproduce
- Create a EDTFDateStringCF custom field with
multiple=True
- Set it's value to a list of two or more dates, .e.g. ["2010-10-28", "1921-08-10"]
- Confirm that the index only contains the above value
- Confirm that an internal query break the single date string into characters (
current_rdm_records_service.search
)
Expected behavior
EDTFDateStringCF with multiple set, should be able to index multiple date values correctly and load and dump them.