Added special handling in a buildForm hook so that it is not necessary to patch the CiviCRM core.