Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • CiviCRM Core CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,466
    • Issues 1,466
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM CoreCiviCRM Core
  • Issues
  • #1157
Closed
Open
Created Jul 29, 2019 by seamuslee@seamusleeMaintainer

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?

@colemanw @eileen @totten @JoeMurray etc

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking