Use isset() instead of empty().
PHP considers 0(0 as an integer) to be empty. Thus the default value gets applied.
isset() determines if the variable is set and so the default value is not applied to field_id when its value is '0'.
This is a good fix. I suspect I mentioned it in my other feedback but adding the "Why" of this fix (even if it's in the linked issue) would be a good idea.
Fixes #115
Use
isset()
instead ofempty()
. PHP considers 0(0 as an integer) to be empty. Thus the default value gets applied.isset()
determines if the variable is set and so the default value is not applied tofield_id
when its value is '0'.