As a workaround you could create a new TV with a “Default Value” of 0 and then use this TV in your MIGX-configuration (field Input TV). It should work this way.
Cheers for that, unfortunately i have maybe 10 or so fields that i want to pre populate with a zero (its for an externally accessed API) and i would rather not create 10 separate TVs just to be able to set a value to 0
but thanks for that, atleast i know it is possible through another route. If anyone else has another alternative way (maybe modifying how migx handles zeros in its component or something) then I’m all ears.
In this instance it is using migx as a tv, but i also have other areas where i am using it with migxDB with custom tables, i have not checked if that stores zero’s yet as i haven’t had the need for it to store one just yet,
With MIGXdb you’d have more options (default values in the database, overriding the save()-function of your class that extends xPDOSimpleObject, maybe using an aftersave-hook snippet).
With MIGX as a TV you could write a plugin that runs on the event “OnDocFormSave”, but it’s probably easier to set the value at output-time like Bruno suggested.
I had the same issue, but I could solve it by setting “0.0” as default value. So the simple default value “0” is shown to my customer in the Migx table.