The pedigree patient form section can cause configurations for other parts of the form to stop working

Description

To reproduce:
1) Go into the Administration section -> Data formats. Check off "ENABLE IMPERIAL UNIT SYSTEM FOR ENTERING MEASUREMENTS" and save.
2) Create a new patient. Observe that the measurement unit system dropdown is displayed in the measurements section, as it should be.
3) On that same patient record, draw a pedigree. Save it and return to the record. (The content of the pedigree is irrelevant).
4) Scroll back down to the Measurements section and observe that the measurement unit system dropdown is no longer displayed.

Cause:
https://github.com/phenotips/phenotips/blob/master/components/pedigree/ui/src/main/resources/PhenoTips/PedigreeMacros.xml#L44
The $config velocity global is being reassigned to the incorrect config object. Many other places in the patient sheet depend on this $config object being assigned to the PhenoTips.DBConfigurationClass xobject on the WebHome xdoc and will break if the variable is assigned to something else.
The reassignment happens inside a conditional block that is entered only if the patient has a pedigree, so this behaviour is only triggered when the patient has a pedigree.

Environment

None

Status

Assignee

Sergiu Dumitriu

Reporter

Daniel Gross

Labels

None

External issue ID

None

External issue ID

None

Fix versions

Affects versions

Priority

Major
Configure