Closed crevillo closed 4 years ago
about your comments 1.- yeah. indeed. i'll work on that too 2.- step by step i guess :). at first i choose de alpha2 mainly because that's normally the same as the key in the ez parameter 3.- can you paste here an example of the struct you're talking about?
There seems to be also a test where some ezcountry field was trying to be added. looks it tried to cover more options as country name and alpha3.
Did it work before even no handler for the field?
"Did it work before even no handler for the field?" => I am not sure whet it did, but it surely did not throw :-D
lol. so, time to fix the code. tdd at its best! so, how do you sugget to implement this? maybe depending on the long of (each) value and some kind of array_search?
Merging #225 into master will increase coverage by
0.04%
. The diff coverage is91.66%
.
@@ Coverage Diff @@
## master #225 +/- ##
============================================
+ Coverage 68.04% 68.08% +0.04%
- Complexity 2637 2641 +4
============================================
Files 124 125 +1
Lines 6865 6877 +12
============================================
+ Hits 4671 4682 +11
- Misses 2194 2195 +1
Impacted Files | Coverage Δ | Complexity Δ | |
---|---|---|---|
Core/FieldHandler/EzCountry.php | 91.66% <91.66%> (ø) |
4 <4> (?) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 4bc51dc...c6aa195. Read the comment docs.
running travis after rebase. before rebasing everything was green. let me know if you miss anything.
Refactored now to use fromHash method from the fieldtype.
i had to delete the country idc from the test. the fromHash method of the country fieldtype doesn't work with ids.
We could restore some of the previous code to have the search as before to allow this possibility too. Thoughts?
Adds support for ez country field allowing entering either a single alpha2 (for non multiple calues cases) or an array of codes for the case the field allows multiple values