Page MenuHomePhabricator

Make configured and EditEngine defaults work correctly for custom fields
ClosedPublic

Authored by epriestley on Dec 17 2015, 5:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 20, 6:38 PM
Unknown Object (File)
Wed, Mar 20, 6:05 PM
Unknown Object (File)
Wed, Mar 20, 3:43 PM
Unknown Object (File)
Wed, Mar 20, 3:26 PM
Unknown Object (File)
Wed, Mar 20, 3:07 PM
Unknown Object (File)
Wed, Mar 20, 3:17 AM
Unknown Object (File)
Tue, Mar 5, 7:18 AM
Unknown Object (File)
Feb 6 2024, 10:50 AM
Subscribers
None

Details

Summary

Ref T10004. Fixes T5158. There was a long-standing issue with defaults not working properly, but EditEngine has made it more obvious because it's a lot easier to set defaults now.

The issue is basically that the defaults are getting set as the field's real value early on, so when we go to generate the transaction "old value" later, we build a transaction that uses the new value as both the "new value" and "old value". Then the engine says "you didn't change anything, so I'm going to ignore this" and drops it.

To fix this, return null as the "old value" by default, and add a call to overwrite that after we load a legitimate old value.

This fix is a touch iffy, but I have some grand plans to clean up the CustomField stuff more broadly later on.

Test Plan
  • Set config defaults on select/typeahead fields, created and edited tasks.
  • Set form defaults on select/typehaead fields, created and edited tasks.
  • In all cases, transactions and state accurately reflected edits.
  • Set defaults on hidden fields, verified forms respected them correctly.
  • This does generate some fluffy transactions, but I'll deal with those in T7661.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Make configured and EditEngine defaults work correctly for custom fields.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
chad edited edge metadata.
This revision is now accepted and ready to land.Dec 17 2015, 6:27 PM
This revision was automatically updated to reflect the committed changes.