What is the meaning of a blank value in a field in QuickForm?
So i have come to this question because of a rather annoying and perculiar situation we have in our system.
We want to populate a contribution custom field value based on a hook_civicrm_post on the contribution which is all fine. It works 90% of the time fine however when using the back office form to add contributions we seem to be in an issue where by the following process appears to happen
Form is submitted -> Form processes the contribution elements -> triggers the hook_civicrm_post hook -> our custom code updates the custom value -> form processes the custom data values on from the QuickForm hook -> custom field was blank on the screen -> CiviCRM overwrites the custom field value with a blank string.
So my question is what is the appropriate resposne when quickform submits a blank field
I would see that if the action is Add then maybe we should just ignore it, but i can see a reason in say Edit mode or similar to clear the data in the database but would appreciate others thoughts.
The other question is that is there any better hook to be using for this purpose?